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

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

Issue 545044: Add the ability to focus a window to chrome.window.update(). (Closed)
Patch Set: tabs Created 10 years, 11 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/chrome_tests.gypi » ('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 aac608194ce564d83b05ed54d75c43481637d76e..a6005415a6d5c20e1c9d300286bb60ec6ee72f1d 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -387,7 +387,15 @@ bool UpdateWindowFunction::RunImpl() {
}
browser->window()->SetBounds(bounds);
- // TODO(rafaelw): Support |focused|.
+
+ if (update_props->HasKey(keys::kFocusedKey)) {
+ bool focused = false;
+ EXTENSION_FUNCTION_VALIDATE(update_props->GetBoolean(keys::kFocusedKey,
+ &focused));
+ if (focused)
+ browser->window()->Activate();
+ }
+
result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false));
return true;
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698