1 // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SUBRESOURCE_TAB_HELPER_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SUBRESOURCE_TAB_HELPER_H_ 7 8 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_user_data.h" 10 11 namespace content { 12 class NavigationHandle; 13 class WebContents; 14 } // namespace content 15 16 namespace safe_browsing { 17 18 class SafeBrowsingSubresourceTabHelper 19 : public content::WebContentsObserver, 20 public content::WebContentsUserData<SafeBrowsingSubresourceTabHelper> { 21 public: 22 ~SafeBrowsingSubresourceTabHelper() override; 23 24 // WebContentsObserver:: 25 void ReadyToCommitNavigation( 26 content::NavigationHandle* navigation_handle) override; 27 28 private: 29 explicit SafeBrowsingSubresourceTabHelper(content::WebContents* web_contents); 30 friend class content::WebContentsUserData<SafeBrowsingSubresourceTabHelper>; 31 32 WEB_CONTENTS_USER_DATA_KEY_DECL(); 33 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingSubresourceTabHelper); 34 }; 35 36 } // namespace safe_browsing 37 38 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SUBRESOURCE_TAB_HELPER_H_ 39