| 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..fb51c2eb1c16989cc05a5a64dfa17a1618bb80f3 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,26 @@ Browser* ExtensionTabUtil::GetBrowserFromWindowID(
|
| }
|
| }
|
|
|
| +Browser* ExtensionTabUtil::GetBrowserFromWindowID(
|
| + 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,
|
| + details.function()->include_incognito(),
|
| + error);
|
| + }
|
| +}
|
| +
|
| int ExtensionTabUtil::GetWindowId(const Browser* browser) {
|
| return browser->session_id().id();
|
| }
|
|
|