Chromium Code Reviews| Index: chrome/browser/extensions/extension_tab_util.cc |
| diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc |
| index a5602ac1e8e43635a713db3c05f95697e1ef6357..79ea362eaf4b5470b149d82a79603d3f2131646d 100644 |
| --- a/chrome/browser/extensions/extension_tab_util.cc |
| +++ b/chrome/browser/extensions/extension_tab_util.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/strings/stringprintf.h" |
| #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| #include "chrome/browser/extensions/chrome_extension_function.h" |
| +#include "chrome/browser/extensions/chrome_extension_function_details.h" |
| #include "chrome/browser/extensions/tab_helper.h" |
| #include "chrome/browser/extensions/window_controller.h" |
| #include "chrome/browser/extensions/window_controller_list.h" |
| @@ -277,6 +278,25 @@ Browser* ExtensionTabUtil::GetBrowserFromWindowID( |
| } |
| } |
| +Browser* ExtensionTabUtil::GetBrowserFromWindowID( |
|
Ken Rockot(use gerrit already)
2014/09/05 19:55:31
Alternatively I guess CEFDetails could provide a p
|
| + ExtensionFunction* function, |
| + const ChromeExtensionFunctionDetails& details, |
| + int window_id, |
| + std::string* error) { |
| + if (window_id == extension_misc::kCurrentWindowId) { |
| + Browser* result = details.GetCurrentBrowser(); |
| + if (!result || !result->window()) { |
| + if (error) |
| + *error = keys::kNoCurrentWindowError; |
| + return NULL; |
| + } |
| + return result; |
| + } else { |
| + return GetBrowserInProfileWithId( |
| + details.GetProfile(), window_id, function->include_incognito(), error); |
| + } |
| +} |
| + |
| int ExtensionTabUtil::GetWindowId(const Browser* browser) { |
| return browser->session_id().id(); |
| } |