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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_interstitial.h

Issue 962413002: Add type for testing to interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_ 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_ 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" 12 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
13 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" 13 #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
14 #include "content/public/browser/interstitial_page_delegate.h" 14 #include "content/public/browser/interstitial_page_delegate.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 namespace content { 17 namespace content {
18 class InterstitialPage; 18 class InterstitialPage;
19 class WebContents; 19 class WebContents;
20 } 20 }
21 21
22 class Profile; 22 class Profile;
23 23
24 // Delegate for an interstitial page when a page is blocked for a supervised 24 // Delegate for an interstitial page when a page is blocked for a supervised
25 // user because it is on a blacklist (in "allow everything" mode) or not on any 25 // user because it is on a blacklist (in "allow everything" mode) or not on any
26 // whitelist (in "allow only specified sites" mode). 26 // whitelist (in "allow only specified sites" mode).
27 class SupervisedUserInterstitial : public content::InterstitialPageDelegate, 27 class SupervisedUserInterstitial : public content::InterstitialPageDelegate,
28 public SupervisedUserServiceObserver { 28 public SupervisedUserServiceObserver {
29 public: 29 public:
30 // Interstitial type, used for testing.
31 static content::InterstitialPageDelegate::TypeID kTypeForTesting;
32
30 static void Show(content::WebContents* web_contents, 33 static void Show(content::WebContents* web_contents,
31 const GURL& url, 34 const GURL& url,
32 SupervisedUserURLFilter::FilteringBehaviorReason reason, 35 SupervisedUserURLFilter::FilteringBehaviorReason reason,
33 const base::Callback<void(bool)>& callback); 36 const base::Callback<void(bool)>& callback);
34 37
38 // content::InterstitialPageDelegate:
Bernhard Bauer 2015/03/03 09:56:00 Can you move this to the private section?
meacer 2015/03/03 18:33:05 Done.
39 content::InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
40
35 private: 41 private:
36 SupervisedUserInterstitial( 42 SupervisedUserInterstitial(
37 content::WebContents* web_contents, 43 content::WebContents* web_contents,
38 const GURL& url, 44 const GURL& url,
39 SupervisedUserURLFilter::FilteringBehaviorReason reason, 45 SupervisedUserURLFilter::FilteringBehaviorReason reason,
40 const base::Callback<void(bool)>& callback); 46 const base::Callback<void(bool)>& callback);
41 ~SupervisedUserInterstitial() override; 47 ~SupervisedUserInterstitial() override;
42 48
43 bool Init(); 49 bool Init();
44 50
(...skipping 29 matching lines...) Expand all
74 SupervisedUserURLFilter::FilteringBehaviorReason reason_; 80 SupervisedUserURLFilter::FilteringBehaviorReason reason_;
75 81
76 base::Callback<void(bool)> callback_; 82 base::Callback<void(bool)> callback_;
77 83
78 base::WeakPtrFactory<SupervisedUserInterstitial> weak_ptr_factory_; 84 base::WeakPtrFactory<SupervisedUserInterstitial> weak_ptr_factory_;
79 85
80 DISALLOW_COPY_AND_ASSIGN(SupervisedUserInterstitial); 86 DISALLOW_COPY_AND_ASSIGN(SupervisedUserInterstitial);
81 }; 87 };
82 88
83 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_ 89 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_INTERSTITIAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698