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

Unified Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 60353003: Enables stacked tabs for aura-metro (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 804be07503a37cd9190e80c8a1c97f1c5b4d5fb5..b495ddedcf775edb04bcb3e78bb49921fc6e6638 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -50,15 +50,20 @@ TabRendererData::NetworkState TabContentsNetworkState(
return TabRendererData::NETWORK_STATE_LOADING;
}
-TabStripLayoutType DetermineTabStripLayout(PrefService* prefs,
- bool* adjust_layout) {
+TabStripLayoutType DetermineTabStripLayout(
+ PrefService* prefs,
+ chrome::HostDesktopType host_desktop_type,
+ bool* adjust_layout) {
*adjust_layout = false;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableStackedTabStrip)) {
return TAB_STRIP_LAYOUT_STACKED;
}
// For chromeos always allow entering stacked mode.
-#if !defined(OS_CHROMEOS)
+#if defined(USE_AURA)
+ if (host_desktop_type != chrome::HOST_DESKTOP_TYPE_ASH)
+ return TAB_STRIP_LAYOUT_SHRINK;
+#else
if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH)
return TAB_STRIP_LAYOUT_SHRINK;
#endif
@@ -355,7 +360,8 @@ bool BrowserTabStripController::IsIncognito() {
void BrowserTabStripController::LayoutTypeMaybeChanged() {
bool adjust_layout = false;
TabStripLayoutType layout_type =
- DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
+ DetermineTabStripLayout(g_browser_process->local_state(),
+ browser_->host_desktop_type(), &adjust_layout);
if (!adjust_layout || layout_type == tabstrip_->layout_type())
return;
@@ -522,6 +528,7 @@ void BrowserTabStripController::AddTab(WebContents* contents,
void BrowserTabStripController::UpdateLayoutType() {
bool adjust_layout = false;
TabStripLayoutType layout_type =
- DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
+ DetermineTabStripLayout(g_browser_process->local_state(),
+ browser_->host_desktop_type(), &adjust_layout);
tabstrip_->SetLayoutType(layout_type, adjust_layout);
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698