OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "base/observer_list.h" | |
Avi (use Gerrit)
2015/07/23 18:25:52
unused; remove
| |
12 #include "base/values.h" | |
13 #include "content/public/browser/notification_observer.h" | |
14 #include "content/public/browser/notification_registrar.h" | |
Avi (use Gerrit)
2015/07/23 18:25:53
both notification lines are unused; remove
| |
15 #include "content/public/browser/web_contents_observer.h" | |
Avi (use Gerrit)
2015/07/23 18:25:53
unused; remove
| |
16 #include "content/public/common/referrer.h" | |
Avi (use Gerrit)
2015/07/23 18:25:53
unused; remove
| |
17 #include "ui/gfx/geometry/size.h" | |
Avi (use Gerrit)
2015/07/23 18:25:52
unused; remove
| |
18 | |
19 namespace net { | |
20 class URLRequestContextGetter; | |
21 } | |
22 | |
23 // This class controls the rendering of the distilled contents | |
24 // generated by a source web contents | |
25 class PrintPreviewDistiller final | |
Avi (use Gerrit)
2015/07/23 18:25:52
We don't use final in Chromium code.
Vitaly Buka (NO REVIEWS)
2015/07/23 18:45:11
Actually it was my advice.
It's allowed according
| |
26 : public base::SupportsWeakPtr<PrintPreviewDistiller> { | |
Avi (use Gerrit)
2015/07/23 18:25:53
Use WeakPtrFactory as a member instead; it has bet
| |
27 public: | |
28 PrintPreviewDistiller(content::WebContents* source_web_contents, | |
29 base::Closure on_failed_callback, | |
30 scoped_ptr<base::DictionaryValue> settings); | |
31 ~PrintPreviewDistiller(); | |
32 | |
33 private: | |
34 class WebContentsDelegateImpl; | |
35 | |
36 // Create the web contents with a default | |
37 // size. |session_storage_namespace| indicates the namespace that | |
38 // the distiller content renderer's page should be part of. | |
39 void CreateDestinationWebContents( | |
40 content::SessionStorageNamespace* session_storage_namespace, | |
41 content::WebContents* source_web_contents, | |
42 scoped_ptr<base::DictionaryValue> settings, | |
43 base::Closure on_failed_callback); | |
44 | |
45 content::WebContents* CreateWebContents( | |
46 content::SessionStorageNamespace* session_storage_namespace, | |
47 content::WebContents* source_web_contents); | |
48 | |
49 // The distilled rendered WebContents; may be null. | |
50 scoped_ptr<content::WebContents> web_contents_; | |
51 | |
52 scoped_ptr<WebContentsDelegateImpl> web_contents_delegate_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDistiller); | |
55 }; | |
56 | |
57 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_ | |
OLD | NEW |