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

Side by Side Diff: chrome/browser/extensions/extension_dom_ui.cc

Issue 2941001: Removal of TabContentsDelegate::GetBrowser() interface method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « chrome/browser/dom_ui/history_ui.cc ('k') | chrome/browser/external_tab_container_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/extensions/extension_dom_ui.h" 5 #include "chrome/browser/extensions/extension_dom_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int request_id, 169 int request_id,
170 bool has_callback) { 170 bool has_callback) {
171 extension_function_dispatcher_->HandleRequest(message, 171 extension_function_dispatcher_->HandleRequest(message,
172 content, 172 content,
173 source_url, 173 source_url,
174 request_id, 174 request_id,
175 has_callback); 175 has_callback);
176 } 176 }
177 177
178 Browser* ExtensionDOMUI::GetBrowser() const { 178 Browser* ExtensionDOMUI::GetBrowser() const {
179 Browser* browser = NULL; 179 // TODO(beng): This is an improper direct dependency on Browser. Route this
180 TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate(); 180 // through some sort of delegate.
181 if (tab_contents_delegate) 181 return BrowserList::FindBrowserWithProfile(DOMUI::GetProfile());
182 browser = tab_contents_delegate->GetBrowser();
183
184 return browser;
185 } 182 }
186 183
187 Profile* ExtensionDOMUI::GetProfile() { 184 Profile* ExtensionDOMUI::GetProfile() {
188 return DOMUI::GetProfile(); 185 return DOMUI::GetProfile();
189 } 186 }
190 187
191 gfx::NativeWindow ExtensionDOMUI::GetCustomFrameNativeWindow() { 188 gfx::NativeWindow ExtensionDOMUI::GetCustomFrameNativeWindow() {
192 if (GetBrowser()) 189 if (GetBrowser())
193 return NULL; 190 return NULL;
194 191
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 381 }
385 382
386 // static 383 // static
387 void ExtensionDOMUI::GetFaviconForURL(Profile* profile, 384 void ExtensionDOMUI::GetFaviconForURL(Profile* profile,
388 FaviconService::GetFaviconRequest* request, const GURL& page_url) { 385 FaviconService::GetFaviconRequest* request, const GURL& page_url) {
389 // tracker deletes itself when done. 386 // tracker deletes itself when done.
390 ExtensionDOMUIImageLoadingTracker* tracker = 387 ExtensionDOMUIImageLoadingTracker* tracker =
391 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url); 388 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url);
392 tracker->Init(); 389 tracker->Init();
393 } 390 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/history_ui.cc ('k') | chrome/browser/external_tab_container_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698