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

Side by Side Diff: chrome/browser/ui/webui/constrained_html_ui.h

Issue 9224002: Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head to clear linux_chromeos browsertest failures Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_HTML_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_CONSTRAINED_HTML_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_HTML_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_HTML_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include "content/browser/webui/web_ui.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 11
12 class ConstrainedWindow; 12 class ConstrainedWindow;
13 class HtmlDialogUIDelegate; 13 class HtmlDialogUIDelegate;
14 class Profile; 14 class Profile;
15 class RenderViewHost; 15 class RenderViewHost;
16 class TabContentsWrapper; 16 class TabContentsWrapper;
17 17
18 namespace base { 18 namespace base {
19 template<class T> class PropertyAccessor; 19 template<class T> class PropertyAccessor;
(...skipping 21 matching lines...) Expand all
41 protected: 41 protected:
42 virtual ~ConstrainedHtmlUIDelegate() {} 42 virtual ~ConstrainedHtmlUIDelegate() {}
43 }; 43 };
44 44
45 // ConstrainedHtmlUI is a facility to show HTML WebUI content 45 // ConstrainedHtmlUI is a facility to show HTML WebUI content
46 // in a tab-modal constrained dialog. It is implemented as an adapter 46 // in a tab-modal constrained dialog. It is implemented as an adapter
47 // between an HtmlDialogUI object and a ConstrainedWindow object. 47 // between an HtmlDialogUI object and a ConstrainedWindow object.
48 // 48 //
49 // Since ConstrainedWindow requires platform-specific delegate 49 // Since ConstrainedWindow requires platform-specific delegate
50 // implementations, this class is just a factory stub. 50 // implementations, this class is just a factory stub.
51 class ConstrainedHtmlUI : public WebUI, public content::WebUIController { 51 class ConstrainedHtmlUI : public content::WebUIController {
52 public: 52 public:
53 explicit ConstrainedHtmlUI(content::WebContents* contents); 53 explicit ConstrainedHtmlUI(WebUI* web_ui);
54 virtual ~ConstrainedHtmlUI(); 54 virtual ~ConstrainedHtmlUI();
55 55
56 // WebUIController implementation: 56 // WebUIController implementation:
57 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; 57 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
58 58
59 // Create a constrained HTML dialog. The actual object that gets created 59 // Create a constrained HTML dialog. The actual object that gets created
60 // is a ConstrainedHtmlUIDelegate, which later triggers construction of a 60 // is a ConstrainedHtmlUIDelegate, which later triggers construction of a
61 // ConstrainedHtmlUI object. 61 // ConstrainedHtmlUI object.
62 static ConstrainedHtmlUIDelegate* CreateConstrainedHtmlDialog( 62 static ConstrainedHtmlUIDelegate* CreateConstrainedHtmlDialog(
63 Profile* profile, 63 Profile* profile,
(...skipping 11 matching lines...) Expand all
75 ConstrainedHtmlUIDelegate* GetConstrainedDelegate(); 75 ConstrainedHtmlUIDelegate* GetConstrainedDelegate();
76 76
77 private: 77 private:
78 // JS Message Handler 78 // JS Message Handler
79 void OnDialogCloseMessage(const base::ListValue* args); 79 void OnDialogCloseMessage(const base::ListValue* args);
80 80
81 DISALLOW_COPY_AND_ASSIGN(ConstrainedHtmlUI); 81 DISALLOW_COPY_AND_ASSIGN(ConstrainedHtmlUI);
82 }; 82 };
83 83
84 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_HTML_UI_H_ 84 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_HTML_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698