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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 10830325: Makes the TabStrip always have the ability to enter stacking mode on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/views/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return TabRendererData::NETWORK_STATE_LOADING; 52 return TabRendererData::NETWORK_STATE_LOADING;
53 } 53 }
54 54
55 TabStripLayoutType DetermineTabStripLayout(PrefService* prefs, 55 TabStripLayoutType DetermineTabStripLayout(PrefService* prefs,
56 bool* adjust_layout) { 56 bool* adjust_layout) {
57 *adjust_layout = false; 57 *adjust_layout = false;
58 if (CommandLine::ForCurrentProcess()->HasSwitch( 58 if (CommandLine::ForCurrentProcess()->HasSwitch(
59 switches::kEnableStackedTabStrip)) { 59 switches::kEnableStackedTabStrip)) {
60 return TAB_STRIP_LAYOUT_STACKED; 60 return TAB_STRIP_LAYOUT_STACKED;
61 } 61 }
62 // For chromeos always allow entering stacked mode.
63 #if !defined(OS_CHROMEOS)
62 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) 64 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH)
63 return TAB_STRIP_LAYOUT_SHRINK; 65 return TAB_STRIP_LAYOUT_SHRINK;
66 #endif
64 *adjust_layout = true; 67 *adjust_layout = true;
65 switch (prefs->GetInteger(prefs::kTabStripLayoutType)) { 68 switch (prefs->GetInteger(prefs::kTabStripLayoutType)) {
66 case TAB_STRIP_LAYOUT_STACKED: 69 case TAB_STRIP_LAYOUT_STACKED:
67 return TAB_STRIP_LAYOUT_STACKED; 70 return TAB_STRIP_LAYOUT_STACKED;
68 default: 71 default:
69 return TAB_STRIP_LAYOUT_SHRINK; 72 return TAB_STRIP_LAYOUT_SHRINK;
70 } 73 }
71 } 74 }
72 75
73 } // namespace 76 } // namespace
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); 579 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB);
577 tabstrip_->AddTabAt(index, data, is_active); 580 tabstrip_->AddTabAt(index, data, is_active);
578 } 581 }
579 582
580 void BrowserTabStripController::UpdateLayoutType() { 583 void BrowserTabStripController::UpdateLayoutType() {
581 bool adjust_layout = false; 584 bool adjust_layout = false;
582 TabStripLayoutType layout_type = 585 TabStripLayoutType layout_type =
583 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); 586 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
584 tabstrip_->SetLayoutType(layout_type, adjust_layout); 587 tabstrip_->SetLayoutType(layout_type, adjust_layout);
585 } 588 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698