Index: chrome/browser/ui/webui/print_preview/print_preview_distiller.h |
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_distiller.h b/chrome/browser/ui/webui/print_preview/print_preview_distiller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cbdb3193f59812b5c0a916f40deb47c335ae81d4 |
--- /dev/null |
+++ b/chrome/browser/ui/webui/print_preview/print_preview_distiller.h |
@@ -0,0 +1,65 @@ |
+// 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 CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ |
+#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ |
+ |
+#include "base/callback.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/observer_list.h" |
+#include "base/values.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+#include "content/public/browser/web_contents_observer.h" |
+#include "content/public/common/referrer.h" |
+#include "ui/gfx/geometry/size.h" |
+ |
+class PrintPreviewUI; |
+ |
+namespace net { |
+class URLRequestContextGetter; |
+} |
+ |
+// This class controls the rendering of the distilled contents |
+// generated by a source web contents |
+class PrintPreviewDistiller |
+ : public base::SupportsWeakPtr<PrintPreviewDistiller> { |
+ public: |
+ PrintPreviewDistiller(content::WebContents* source_web_contents, |
+ PrintPreviewUI* print_preview_ui, |
+ scoped_ptr<base::DictionaryValue> settings); |
+ virtual ~PrintPreviewDistiller(); |
Vitaly Buka (NO REVIEWS)
2015/07/20 20:45:33
Please make "class PrintPreviewDistiller final :"
arjunpatel
2015/07/21 17:25:01
Acknowledged.
|
+ |
+ void Abort(); |
Vitaly Buka (NO REVIEWS)
2015/07/20 20:45:33
Abort also can be removed.
arjunpatel
2015/07/21 17:25:01
Acknowledged.
|
+ |
+ content::WebContents* GetWebContents(); |
Vitaly Buka (NO REVIEWS)
2015/07/20 20:45:33
Getter can be removed if WebContentsDelegateImpl u
arjunpatel
2015/07/21 17:25:00
Acknowledged.
|
+ |
+ private: |
+ // Create the web contents with a default |
+ // size. |session_storage_namespace| indicates the namespace that |
+ // the distiller content renderer's page should be part of. |
+ virtual void CreateDestinationWebContents( |
+ content::SessionStorageNamespace* session_storage_namespace, |
+ content::WebContents* source_web_contents, |
+ scoped_ptr<base::DictionaryValue> settings); |
+ |
+ class WebContentsDelegateImpl; |
Vitaly Buka (NO REVIEWS)
2015/07/20 20:45:33
"class" declaration should go before methods, just
arjunpatel
2015/07/21 17:25:01
Acknowledged.
|
+ |
+ content::WebContents* CreateWebContents( |
+ content::SessionStorageNamespace* session_storage_namespace, |
+ content::WebContents* source_web_contents); |
+ |
+ // The distilled rendered WebContents; may be null. |
+ scoped_ptr<content::WebContents> web_contents_; |
+ |
+ scoped_ptr<WebContentsDelegateImpl> web_contents_delegate_; |
+ |
+ // The callback called when the preview failed. |
+ base::Closure on_failed_callback_; |
Vitaly Buka (NO REVIEWS)
2015/07/20 20:45:33
This class doesn't need on_failed_callback_, only
arjunpatel
2015/07/21 17:25:01
Acknowledged.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(PrintPreviewDistiller); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ |