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

Side by Side Diff: chrome/browser/printing/print_preview_message_handler.h

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chrome/browser/common/web_contents_user_data.h" 9 #include "chrome/browser/common/web_contents_user_data.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
(...skipping 17 matching lines...) Expand all
28 : public content::WebContentsObserver, 28 : public content::WebContentsObserver,
29 public WebContentsUserData<PrintPreviewMessageHandler> { 29 public WebContentsUserData<PrintPreviewMessageHandler> {
30 public: 30 public:
31 virtual ~PrintPreviewMessageHandler(); 31 virtual ~PrintPreviewMessageHandler();
32 32
33 // content::WebContentsObserver implementation. 33 // content::WebContentsObserver implementation.
34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
35 35
36 private: 36 private:
37 explicit PrintPreviewMessageHandler(content::WebContents* web_contents); 37 explicit PrintPreviewMessageHandler(content::WebContents* web_contents);
38 static int kUserDataKey;
39 friend class WebContentsUserData<PrintPreviewMessageHandler>; 38 friend class WebContentsUserData<PrintPreviewMessageHandler>;
40 39
41 // Gets the print preview tab associated with the WebContents being observed. 40 // Gets the print preview tab associated with the WebContents being observed.
42 TabContents* GetPrintPreviewTab(); 41 TabContents* GetPrintPreviewTab();
43 42
44 // Gets the PrintPreviewUI associated with the WebContents being observed. 43 // Gets the PrintPreviewUI associated with the WebContents being observed.
45 PrintPreviewUI* GetPrintPreviewUI(); 44 PrintPreviewUI* GetPrintPreviewUI();
46 45
47 // Message handlers. 46 // Message handlers.
48 void OnRequestPrintPreview(bool source_is_modifiable, bool webnode_only); 47 void OnRequestPrintPreview(bool source_is_modifiable, bool webnode_only);
(...skipping 10 matching lines...) Expand all
59 void OnPrintPreviewCancelled(int document_cookie); 58 void OnPrintPreviewCancelled(int document_cookie);
60 void OnInvalidPrinterSettings(int document_cookie); 59 void OnInvalidPrinterSettings(int document_cookie);
61 void OnPrintPreviewScalingDisabled(); 60 void OnPrintPreviewScalingDisabled();
62 61
63 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); 62 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler);
64 }; 63 };
65 64
66 } // namespace printing 65 } // namespace printing
67 66
68 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ 67 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698