Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / supervised_user / supervised_user_interstitial.h
index 7956761..19890ea 100644 (file)
@@ -8,6 +8,7 @@
 #include <string>
 
 #include "base/callback.h"
+#include "base/memory/weak_ptr.h"
 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
 #include "content/public/browser/interstitial_page_delegate.h"
 #include "url/gurl.h"
@@ -33,22 +34,27 @@ class SupervisedUserInterstitial : public content::InterstitialPageDelegate,
   SupervisedUserInterstitial(content::WebContents* web_contents,
                              const GURL& url,
                              const base::Callback<void(bool)>& callback);
-  virtual ~SupervisedUserInterstitial();
+  ~SupervisedUserInterstitial() override;
 
   bool Init();
 
   // InterstitialPageDelegate implementation.
-  virtual std::string GetHTMLContents() OVERRIDE;
-  virtual void CommandReceived(const std::string& command) OVERRIDE;
-  virtual void OnProceed() OVERRIDE;
-  virtual void OnDontProceed() OVERRIDE;
+  std::string GetHTMLContents() override;
+  void CommandReceived(const std::string& command) override;
+  void OnProceed() override;
+  void OnDontProceed() override;
 
   // SupervisedUserServiceObserver implementation.
-  virtual void OnURLFilterChanged() OVERRIDE;
+  void OnURLFilterChanged() override;
+  // TODO(treib): Also listen to OnCustodianInfoChanged and update as required.
 
-  // Returns whether the blocked URL is now allowed. Called initially before the
-  // interstitial is shown (to catch race conditions), or when the URL filtering
-  // prefs change.
+  void OnAccessRequestAdded(bool success);
+
+  // Returns whether there is a manual exception for the blocked URL.
+  // Called initially before the interstitial is shown (to catch race
+  // conditions), or when the URL filtering prefs change. Note that this does
+  // not include the asynchronous online checks, so the return value indicates
+  // either "allow" or "don't know".
   bool ShouldProceed();
 
   void DispatchContinueRequest(bool continue_request);
@@ -64,6 +70,8 @@ class SupervisedUserInterstitial : public content::InterstitialPageDelegate,
 
   base::Callback<void(bool)> callback_;
 
+  base::WeakPtrFactory<SupervisedUserInterstitial> weak_ptr_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(SupervisedUserInterstitial);
 };