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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 21022018: Sessions API - previously Session Restore API. Supports restoring currently open foreign windows an… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated Created 7 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 side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698