Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_debug_ui_manager_base.h |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_debug_ui_manager_base.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_debug_ui_manager_base.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5aefbc4b29dfcf72660fa5f606bf4f81906f3999 |
--- /dev/null |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_debug_ui_manager_base.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_DEBUG_UI_MANAGER_BASE_H_ |
+#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_DEBUG_UI_MANAGER_BASE_H_ |
+ |
+#include <vector> |
+ |
+#include "base/callback.h" |
+#include "base/memory/ref_counted.h" |
+#include "url/gurl.h" |
+ |
+namespace data_reduction_proxy { |
+ |
+class DataReductionProxyDebugUIManagerBase |
+ : public base::RefCountedThreadSafe<DataReductionProxyDebugUIManagerBase> { |
+ public: |
+ // Passed a boolean indicating whether or not it is OK to proceed with |
+ // loading an URL. |
+ typedef base::Callback<void(bool /*proceed*/)> UrlCheckCallback; |
+ |
+ // Structure used to pass parameters between the IO and UI thread when |
+ // interacting with the blocking page. |
+ struct BypassResource { |
+ BypassResource() |
+ : is_subresource(false), |
+ render_process_host_id(-1), |
+ render_view_id(-1) {}; |
+ ~BypassResource() {}; |
+ |
+ GURL url; |
+ bool is_subresource; |
+ UrlCheckCallback callback; // This is called back on the IO thread. |
+ int render_process_host_id; |
+ int render_view_id; |
+ }; |
+ |
+ // Using |resource.render_process_host_id| and |resource.render_view_id| |
+ // checks if WebContents exists for the RenderViewHost retreived from these |
+ // id's. |
+ virtual bool IsTabClosed(const BypassResource& resource) const = 0; |
+ |
+ // Called on the UI thread to display a blocking page. |url| is the url |
+ // of the resource that bypassed. If the request contained a chain of |
+ // redirects, |url| is the last url in the chain. |
+ virtual void DisplayBlockingPage(const BypassResource& resource) = 0; |
+ |
+ // The blocking page on the UI thread has completed. |
+ virtual void OnBlockingPageDone( |
+ const std::vector<BypassResource>& resources, bool proceed) = 0; |
+ |
+ protected: |
+ friend class base::RefCountedThreadSafe<DataReductionProxyDebugUIManagerBase>; |
+ virtual ~DataReductionProxyDebugUIManagerBase() {} |
+}; |
+ |
+} // namespace data_reduction_proxy |
+ |
+#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_DEBUG_UI_MANAGER_BASE_H_ |