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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_distiller.h

Issue 1125343004: Add a "Simplify Page" option to the print preview dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring following the proposals in the reviews Created 5 years, 5 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
(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"
12 #include "base/values.h"
13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h"
15 #include "content/public/browser/web_contents_observer.h"
16 #include "content/public/common/referrer.h"
17 #include "ui/gfx/geometry/size.h"
18
19 class PrintPreviewUI;
20
21 namespace net {
22 class URLRequestContextGetter;
23 }
24
25 // This class controls the rendering of the distilled contents
26 // generated by a source web contents
27 class PrintPreviewDistiller
28 : public base::SupportsWeakPtr<PrintPreviewDistiller> {
29 public:
30 PrintPreviewDistiller(content::WebContents* source_web_contents,
31 PrintPreviewUI* print_preview_ui,
32 scoped_ptr<base::DictionaryValue> settings);
33 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.
34
35 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.
36
37 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.
38
39 private:
40 // Create the web contents with a default
41 // size. |session_storage_namespace| indicates the namespace that
42 // the distiller content renderer's page should be part of.
43 virtual void CreateDestinationWebContents(
44 content::SessionStorageNamespace* session_storage_namespace,
45 content::WebContents* source_web_contents,
46 scoped_ptr<base::DictionaryValue> settings);
47
48 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.
49
50 content::WebContents* CreateWebContents(
51 content::SessionStorageNamespace* session_storage_namespace,
52 content::WebContents* source_web_contents);
53
54 // The distilled rendered WebContents; may be null.
55 scoped_ptr<content::WebContents> web_contents_;
56
57 scoped_ptr<WebContentsDelegateImpl> web_contents_delegate_;
58
59 // The callback called when the preview failed.
60 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.
61
62 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDistiller);
63 };
64
65 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DISTILLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698