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

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 3584010: Add chrome.windows.update({focused:true}); (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 2 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/extension_api.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tabs_module.cc
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 8e04e1949d61c770c9aa7809e37b42992950d073..9c580a8d56c152b3b84ad5a97fd01952087c546a 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -449,8 +449,18 @@ bool UpdateWindowFunction::RunImpl() {
&bounds_val));
bounds.set_height(bounds_val);
}
-
browser->window()->SetBounds(bounds);
+
+ bool selected_val = false;
+ if (update_props->HasKey(keys::kFocusedKey)) {
+ EXTENSION_FUNCTION_VALIDATE(update_props->GetBoolean(
+ keys::kFocusedKey, &selected_val));
+ if (selected_val)
+ browser->window()->Activate();
+ else
+ browser->window()->Deactivate();
+ }
+
result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false));
return true;
« no previous file with comments | « no previous file | chrome/common/extensions/api/extension_api.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698