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

Side by Side Diff: chrome/browser/extensions/extension_web_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_EXTENSIONS_EXTENSION_WEB_UI_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" 12 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h"
13 #include "chrome/browser/favicon/favicon_service.h" 13 #include "chrome/browser/favicon/favicon_service.h"
14 #include "chrome/common/extensions/extension.h" 14 #include "chrome/common/extensions/extension.h"
15 #include "content/browser/webui/web_ui.h"
16 #include "content/public/browser/web_ui_controller.h" 15 #include "content/public/browser/web_ui_controller.h"
17 16
18 class PrefService; 17 class PrefService;
19 class Profile; 18 class Profile;
20 19
21 // This class implements WebUI for extensions and allows extensions to put UI in 20 // This class implements WebUI for extensions and allows extensions to put UI in
22 // the main tab contents area. For example, each extension can specify an 21 // the main tab contents area. For example, each extension can specify an
23 // "options_page", and that page is displayed in the tab contents area and is 22 // "options_page", and that page is displayed in the tab contents area and is
24 // hosted by this class. 23 // hosted by this class.
25 class ExtensionWebUI : public WebUI, public content::WebUIController { 24 class ExtensionWebUI : public content::WebUIController {
26 public: 25 public:
27 static const char kExtensionURLOverrides[]; 26 static const char kExtensionURLOverrides[];
28 27
29 ExtensionWebUI(content::WebContents* web_contents, const GURL& url); 28 ExtensionWebUI(WebUI* web_ui, const GURL& url);
30 29
31 virtual ~ExtensionWebUI(); 30 virtual ~ExtensionWebUI();
32 31
33 virtual BookmarkManagerExtensionEventRouter* 32 virtual BookmarkManagerExtensionEventRouter*
34 bookmark_manager_extension_event_router(); 33 bookmark_manager_extension_event_router();
35 34
36 // BrowserURLHandler 35 // BrowserURLHandler
37 static bool HandleChromeURLOverride(GURL* url, 36 static bool HandleChromeURLOverride(GURL* url,
38 content::BrowserContext* browser_context); 37 content::BrowserContext* browser_context);
39 static bool HandleChromeURLOverrideReverse( 38 static bool HandleChromeURLOverrideReverse(
(...skipping 29 matching lines...) Expand all
69 // TODO(aa): This seems out of place. Why is it not with the event routers for 68 // TODO(aa): This seems out of place. Why is it not with the event routers for
70 // the other extension APIs? 69 // the other extension APIs?
71 scoped_ptr<BookmarkManagerExtensionEventRouter> 70 scoped_ptr<BookmarkManagerExtensionEventRouter>
72 bookmark_manager_extension_event_router_; 71 bookmark_manager_extension_event_router_;
73 72
74 // The URL this WebUI was created for. 73 // The URL this WebUI was created for.
75 GURL url_; 74 GURL url_;
76 }; 75 };
77 76
78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ 77 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698