| Index: chrome/browser/extensions/api/tabs/tabs_api.cc
|
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| index d574db96eaa10fae67dd20bd6056f3f7112d727a..f7a1f948fdc77e78450c3aff418b4a3987772874 100644
|
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| @@ -24,6 +24,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
|
| +#include "chrome/browser/extensions/api/tabs/windows_helper.h"
|
| #include "chrome/browser/extensions/extension_function_dispatcher.h"
|
| #include "chrome/browser/extensions/extension_function_util.h"
|
| #include "chrome/browser/extensions/extension_host.h"
|
| @@ -170,36 +171,6 @@ bool GetBrowserFromWindowID(
|
| return true;
|
| }
|
|
|
| -bool GetWindowFromWindowID(UIThreadExtensionFunction* function,
|
| - int window_id,
|
| - WindowController** controller) {
|
| - if (window_id == extension_misc::kCurrentWindowId) {
|
| - WindowController* extension_window_controller =
|
| - function->dispatcher()->delegate()->GetExtensionWindowController();
|
| - // If there is a window controller associated with this extension, use that.
|
| - if (extension_window_controller) {
|
| - *controller = extension_window_controller;
|
| - } else {
|
| - // Otherwise get the focused or most recently added window.
|
| - *controller = WindowControllerList::GetInstance()->
|
| - CurrentWindowForFunction(function);
|
| - }
|
| - if (!(*controller)) {
|
| - function->SetError(keys::kNoCurrentWindowError);
|
| - return false;
|
| - }
|
| - } else {
|
| - *controller = WindowControllerList::GetInstance()->
|
| - FindWindowForFunctionById(function, window_id);
|
| - if (!(*controller)) {
|
| - function->SetError(ErrorUtils::FormatErrorMessage(
|
| - keys::kWindowNotFoundError, base::IntToString(window_id)));
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| -}
|
| -
|
| // |error_message| can optionally be passed in and will be set with an
|
| // appropriate message if the tab cannot be found by id.
|
| bool GetTabById(int tab_id,
|
|
|