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

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

Issue 8586045: Add extension API to change window show state using chrome.windows.update(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 9 years, 1 month 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 | « chrome/browser/extensions/extension_tab_util.h ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51030fed8d90e2e11adeb3bf0281b6926824bae5..c6ccb667d421cdecca76b057931b79f38bb93bc5 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -59,6 +59,16 @@ std::string ExtensionTabUtil::GetWindowTypeText(const Browser* browser) {
return keys::kWindowTypeValueNormal;
}
+// Return the state name for a browser window state.
+std::string ExtensionTabUtil::GetWindowShowStateText(const Browser* browser) {
+ BrowserWindow* window = browser->window();
+ if (window->IsMinimized())
+ return keys::kShowStateValueMinimized;
+ if (window->IsMaximized() || window->IsFullscreen())
+ return keys::kShowStateValueMaximized;
+ return keys::kShowStateValueNormal;
+}
+
DictionaryValue* ExtensionTabUtil::CreateTabValue(
const TabContents* contents) {
// Find the tab strip and index of this guy.
@@ -146,6 +156,7 @@ DictionaryValue* ExtensionTabUtil::CreateWindowValue(const Browser* browser,
result->SetInteger(keys::kWidthKey, bounds.width());
result->SetInteger(keys::kHeightKey, bounds.height());
result->SetString(keys::kWindowTypeKey, GetWindowTypeText(browser));
+ result->SetString(keys::kShowStateKey, GetWindowShowStateText(browser));
if (populate_tabs) {
result->Set(keys::kTabsKey, ExtensionTabUtil::CreateTabList(browser));
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.h ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698