| OLD | NEW |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 int request_id, | 170 int request_id, |
| 171 bool has_callback) { | 171 bool has_callback) { |
| 172 extension_function_dispatcher_->HandleRequest(message, | 172 extension_function_dispatcher_->HandleRequest(message, |
| 173 content, | 173 content, |
| 174 source_url, | 174 source_url, |
| 175 request_id, | 175 request_id, |
| 176 has_callback); | 176 has_callback); |
| 177 } | 177 } |
| 178 | 178 |
| 179 Browser* ExtensionDOMUI::GetBrowser() const { | 179 Browser* ExtensionDOMUI::GetBrowser() const { |
| 180 Browser* browser = NULL; | 180 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 181 TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate(); | 181 // through some sort of delegate. |
| 182 if (tab_contents_delegate) | 182 return BrowserList::FindBrowserWithProfile(DOMUI::GetProfile()); |
| 183 browser = tab_contents_delegate->GetBrowser(); | |
| 184 | |
| 185 return browser; | |
| 186 } | 183 } |
| 187 | 184 |
| 188 Profile* ExtensionDOMUI::GetProfile() { | 185 Profile* ExtensionDOMUI::GetProfile() { |
| 189 return DOMUI::GetProfile(); | 186 return DOMUI::GetProfile(); |
| 190 } | 187 } |
| 191 | 188 |
| 192 gfx::NativeWindow ExtensionDOMUI::GetCustomFrameNativeWindow() { | 189 gfx::NativeWindow ExtensionDOMUI::GetCustomFrameNativeWindow() { |
| 193 if (GetBrowser()) | 190 if (GetBrowser()) |
| 194 return NULL; | 191 return NULL; |
| 195 | 192 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 382 } |
| 386 | 383 |
| 387 // static | 384 // static |
| 388 void ExtensionDOMUI::GetFaviconForURL(Profile* profile, | 385 void ExtensionDOMUI::GetFaviconForURL(Profile* profile, |
| 389 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 386 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 390 // tracker deletes itself when done. | 387 // tracker deletes itself when done. |
| 391 ExtensionDOMUIImageLoadingTracker* tracker = | 388 ExtensionDOMUIImageLoadingTracker* tracker = |
| 392 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url); | 389 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url); |
| 393 tracker->Init(); | 390 tracker->Init(); |
| 394 } | 391 } |
| OLD | NEW |