Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_host.h

Issue 2669013002: Convert ClientSideDetectionHost to use the new navigation callbacks. (Closed)
Patch Set: fix unittests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 39
40 // From content::WebContentsObserver. 40 // From content::WebContentsObserver.
41 bool OnMessageReceived(const IPC::Message& message, 41 bool OnMessageReceived(const IPC::Message& message,
42 content::RenderFrameHost* render_frame_host) override; 42 content::RenderFrameHost* render_frame_host) override;
43 void DidGetResourceResponseStart( 43 void DidGetResourceResponseStart(
44 const content::ResourceRequestDetails& details) override; 44 const content::ResourceRequestDetails& details) override;
45 45
46 // From content::WebContentsObserver. If we navigate away we cancel all 46 // From content::WebContentsObserver. If we navigate away we cancel all
47 // pending callbacks that could show an interstitial, and check to see whether 47 // pending callbacks that could show an interstitial, and check to see whether
48 // we should classify the new URL. 48 // we should classify the new URL.
49 void DidNavigateMainFrame( 49 void DidFinishNavigation(
50 const content::LoadCommittedDetails& details, 50 content::NavigationHandle* navigation_handle) override;
51 const content::FrameNavigateParams& params) override;
52 51
53 // Called when the SafeBrowsingService found a hit with one of the 52 // Called when the SafeBrowsingService found a hit with one of the
54 // SafeBrowsing lists. This method is called on the UI thread. 53 // SafeBrowsing lists. This method is called on the UI thread.
55 void OnSafeBrowsingHit( 54 void OnSafeBrowsingHit(
56 const security_interstitials::UnsafeResource& resource) override; 55 const security_interstitials::UnsafeResource& resource) override;
57 56
58 virtual scoped_refptr<SafeBrowsingDatabaseManager> database_manager(); 57 virtual scoped_refptr<SafeBrowsingDatabaseManager> database_manager();
59 58
59 static void IgnoreMimeTypeCheckForTesting(bool ignore);
mattm 2017/02/07 20:35:47 Why is this necessary now? If the new stuff means
mattm 2017/02/07 20:35:47 Also the comment for SetContentsMimeType might nee
jam 2017/02/07 20:39:40 Correct, that's the reason. The only place that c
60
60 protected: 61 protected:
61 explicit ClientSideDetectionHost(content::WebContents* tab); 62 explicit ClientSideDetectionHost(content::WebContents* tab);
62 63
63 // From content::WebContentsObserver. 64 // From content::WebContentsObserver.
64 void WebContentsDestroyed() override; 65 void WebContentsDestroyed() override;
65 66
66 // Used for testing. 67 // Used for testing.
67 void set_safe_browsing_managers( 68 void set_safe_browsing_managers(
68 SafeBrowsingUIManager* ui_manager, 69 SafeBrowsingUIManager* ui_manager,
69 SafeBrowsingDatabaseManager* database_manager); 70 SafeBrowsingDatabaseManager* database_manager);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 std::unique_ptr<security_interstitials::UnsafeResource> unsafe_resource_; 166 std::unique_ptr<security_interstitials::UnsafeResource> unsafe_resource_;
166 167
167 base::WeakPtrFactory<ClientSideDetectionHost> weak_factory_; 168 base::WeakPtrFactory<ClientSideDetectionHost> weak_factory_;
168 169
169 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionHost); 170 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionHost);
170 }; 171 };
171 172
172 } // namespace safe_browsing 173 } // namespace safe_browsing
173 174
174 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_ 175 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698