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

Unified Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_web_ui.cc
===================================================================
--- chrome/browser/extensions/extension_web_ui.cc (revision 116011)
+++ chrome/browser/extensions/extension_web_ui.cc (working copy)
@@ -24,7 +24,8 @@
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/tab_contents/tab_contents.h"
+#include "content/browser/tab_contents/navigation_controller.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/bindings_policy.h"
#include "net/base/file_stream.h"
@@ -32,6 +33,8 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/favicon_size.h"
+using content::WebContents;
+
namespace {
// De-dupes the items in |list|. Assumes the values are strings.
@@ -124,11 +127,11 @@
const char ExtensionWebUI::kExtensionURLOverrides[] =
"extensions.chrome_url_overrides";
-ExtensionWebUI::ExtensionWebUI(TabContents* tab_contents, const GURL& url)
- : ChromeWebUI(tab_contents),
+ExtensionWebUI::ExtensionWebUI(WebContents* web_contents, const GURL& url)
+ : ChromeWebUI(web_contents),
url_(url) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->GetBrowserContext());
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
const Extension* extension =
service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url));
@@ -147,7 +150,7 @@
if (browser_command_line.HasSwitch(switches::kChromeFrame))
bindings_ |= content::BINDINGS_POLICY_EXTERNAL_HOST;
// For chrome:// overrides, some of the defaults are a little different.
- GURL effective_url = tab_contents->GetURL();
+ GURL effective_url = web_contents->GetURL();
if (effective_url.SchemeIs(chrome::kChromeUIScheme)) {
if (effective_url.host() == chrome::kChromeUINewTabHost) {
focus_location_bar_by_default_ = true;
@@ -160,7 +163,7 @@
// Hack: A few things we specialize just for the bookmark manager.
if (extension->id() == extension_misc::kBookmarkManagerId) {
TabContentsWrapper* tab =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
+ TabContentsWrapper::GetCurrentWrapperForContents(web_contents);
DCHECK(tab);
bookmark_manager_extension_event_router_.reset(
new BookmarkManagerExtensionEventRouter(profile, tab));
@@ -340,7 +343,7 @@
// This is the active override, so we need to find all existing
// tabs for this override and get them to reload the original URL.
for (TabContentsIterator iterator; !iterator.done(); ++iterator) {
- TabContents* tab = (*iterator)->tab_contents();
+ WebContents* tab = (*iterator)->web_contents();
Profile* tab_profile =
Profile::FromBrowserContext(tab->GetBrowserContext());
if (tab_profile != profile)
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.h ('k') | chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698