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

Side by Side Diff: ui/web_dialogs/constrained_web_dialog_ui.h

Issue 10448066: Move the web dialogs code to src/ui/web_dialogs from src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 5 #ifndef UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 6 #define UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/public/browser/web_ui_controller.h" 10 #include "content/public/browser/web_ui_controller.h"
11 #include "ui/web_dialogs/web_dialogs_export.h"
11 12
12 class ConstrainedWindow; 13 class ConstrainedWindow;
13 class Profile; 14 class Profile;
14 class TabContentsWrapper; 15 class TabContentsWrapper;
15 class WebDialogDelegate;
16 class WebDialogWebContentsDelegate; 16 class WebDialogWebContentsDelegate;
17 17
18 namespace base { 18 namespace base {
19 template<class T> class PropertyAccessor; 19 template<class T> class PropertyAccessor;
20 } 20 }
21 21
22 namespace content { 22 namespace content {
23 class RenderViewHost; 23 class RenderViewHost;
24 } 24 }
25 25
26 class ConstrainedWebDialogDelegate { 26 namespace ui {
27 class WebDialogDelegate;
28
29 class WEB_DIALOGS_EXPORT ConstrainedWebDialogDelegate {
27 public: 30 public:
28 virtual const WebDialogDelegate* GetWebDialogDelegate() const = 0; 31 virtual const WebDialogDelegate* GetWebDialogDelegate() const = 0;
29 virtual WebDialogDelegate* GetWebDialogDelegate() = 0; 32 virtual WebDialogDelegate* GetWebDialogDelegate() = 0;
30 33
31 // Called when the dialog is being closed in response to a "DialogClose" 34 // Called when the dialog is being closed in response to a "DialogClose"
32 // message from WebUI. 35 // message from WebUI.
33 virtual void OnDialogCloseFromWebUI() = 0; 36 virtual void OnDialogCloseFromWebUI() = 0;
34 37
35 // If called, on dialog closure, the dialog will release its WebContents 38 // If called, on dialog closure, the dialog will release its WebContents
36 // instead of destroying it. After which point, the caller will own the 39 // instead of destroying it. After which point, the caller will own the
(...skipping 11 matching lines...) Expand all
48 }; 51 };
49 52
50 // ConstrainedWebDialogUI is a facility to show HTML WebUI content 53 // ConstrainedWebDialogUI is a facility to show HTML WebUI content
51 // in a tab-modal constrained dialog. It is implemented as an adapter 54 // in a tab-modal constrained dialog. It is implemented as an adapter
52 // between an WebDialogUI object and a ConstrainedWindow object. 55 // between an WebDialogUI object and a ConstrainedWindow object.
53 // 56 //
54 // Since ConstrainedWindow requires platform-specific delegate 57 // Since ConstrainedWindow requires platform-specific delegate
55 // implementations, this class is just a factory stub. 58 // implementations, this class is just a factory stub.
56 // TODO(thestig) Refactor the platform-independent code out of the 59 // TODO(thestig) Refactor the platform-independent code out of the
57 // platform-specific implementations. 60 // platform-specific implementations.
58 class ConstrainedWebDialogUI : public content::WebUIController { 61 class WEB_DIALOGS_EXPORT ConstrainedWebDialogUI
62 : public content::WebUIController {
59 public: 63 public:
60 explicit ConstrainedWebDialogUI(content::WebUI* web_ui); 64 explicit ConstrainedWebDialogUI(content::WebUI* web_ui);
61 virtual ~ConstrainedWebDialogUI(); 65 virtual ~ConstrainedWebDialogUI();
62 66
63 // WebUIController implementation: 67 // WebUIController implementation:
64 virtual void RenderViewCreated( 68 virtual void RenderViewCreated(
65 content::RenderViewHost* render_view_host) OVERRIDE; 69 content::RenderViewHost* render_view_host) OVERRIDE;
66 70
67 // Create a constrained HTML dialog. The actual object that gets created 71 // Create a constrained HTML dialog. The actual object that gets created
68 // is a ConstrainedWebDialogDelegate, which later triggers construction of a 72 // is a ConstrainedWebDialogDelegate, which later triggers construction of a
(...skipping 21 matching lines...) Expand all
90 // Returns NULL if that property is not set. 94 // Returns NULL if that property is not set.
91 ConstrainedWebDialogDelegate* GetConstrainedDelegate(); 95 ConstrainedWebDialogDelegate* GetConstrainedDelegate();
92 96
93 private: 97 private:
94 // JS Message Handler 98 // JS Message Handler
95 void OnDialogCloseMessage(const base::ListValue* args); 99 void OnDialogCloseMessage(const base::ListValue* args);
96 100
97 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogUI); 101 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogUI);
98 }; 102 };
99 103
100 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 104 } // namespace ui
105
106 #endif // UI_WEB_DIALOGS_CONSTRAINED_WEB_DIALOG_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698