Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 #include "chrome/browser/extensions/extension_tab_util.h" | 6 #include "chrome/browser/extensions/extension_tab_util.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 if (browser->is_app()) | 62 if (browser->is_app()) |
| 63 return keys::kWindowTypeValueApp; | 63 return keys::kWindowTypeValueApp; |
| 64 return keys::kWindowTypeValueNormal; | 64 return keys::kWindowTypeValueNormal; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Return the state name for a browser window state. | 67 // Return the state name for a browser window state. |
| 68 std::string ExtensionTabUtil::GetWindowShowStateText(const Browser* browser) { | 68 std::string ExtensionTabUtil::GetWindowShowStateText(const Browser* browser) { |
| 69 BrowserWindow* window = browser->window(); | 69 BrowserWindow* window = browser->window(); |
| 70 if (window->IsMinimized()) | 70 if (window->IsMinimized()) |
| 71 return keys::kShowStateValueMinimized; | 71 return keys::kShowStateValueMinimized; |
| 72 if (window->IsMaximized() || window->IsFullscreen()) | 72 if (window->IsFullscreen()) |
| 73 return keys::kShowStateValueFullscreen; | |
|
Mihai Parparita -not on Chrome
2012/02/06 22:31:34
Aaron: are we worried about this change not being
jennb
2012/02/06 23:34:25
Panels cannot go fullscreen so there's no backward
| |
| 74 if (window->IsMaximized()) | |
| 73 return keys::kShowStateValueMaximized; | 75 return keys::kShowStateValueMaximized; |
| 74 return keys::kShowStateValueNormal; | 76 return keys::kShowStateValueNormal; |
| 75 } | 77 } |
| 76 | 78 |
| 77 DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents) { | 79 DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents) { |
| 78 // Find the tab strip and index of this guy. | 80 // Find the tab strip and index of this guy. |
| 79 TabStripModel* tab_strip = NULL; | 81 TabStripModel* tab_strip = NULL; |
| 80 int tab_index; | 82 int tab_index; |
| 81 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) | 83 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) |
| 82 return ExtensionTabUtil::CreateTabValue(contents, tab_strip, tab_index); | 84 return ExtensionTabUtil::CreateTabValue(contents, tab_strip, tab_index); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 *contents = target_contents; | 246 *contents = target_contents; |
| 245 if (tab_index) | 247 if (tab_index) |
| 246 *tab_index = i; | 248 *tab_index = i; |
| 247 return true; | 249 return true; |
| 248 } | 250 } |
| 249 } | 251 } |
| 250 } | 252 } |
| 251 } | 253 } |
| 252 return false; | 254 return false; |
| 253 } | 255 } |
| OLD | NEW |