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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/task_manager_view.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/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1243
1244 // If the active tab is being dragged, it goes last. 1244 // If the active tab is being dragged, it goes last.
1245 if (active_tab && is_dragging) 1245 if (active_tab && is_dragging)
1246 active_tab->Paint(canvas, cull_set); 1246 active_tab->Paint(canvas, cull_set);
1247 } 1247 }
1248 1248
1249 const char* TabStrip::GetClassName() const { 1249 const char* TabStrip::GetClassName() const {
1250 return kViewClassName; 1250 return kViewClassName;
1251 } 1251 }
1252 1252
1253 gfx::Size TabStrip::GetPreferredSize() { 1253 gfx::Size TabStrip::GetPreferredSize() const {
1254 // For stacked tabs the minimum size is calculated as the size needed to 1254 // For stacked tabs the minimum size is calculated as the size needed to
1255 // handle showing any number of tabs. Otherwise report the minimum width as 1255 // handle showing any number of tabs. Otherwise report the minimum width as
1256 // the size required for a single selected tab plus the new tab button. Don't 1256 // the size required for a single selected tab plus the new tab button. Don't
1257 // base it on the actual number of tabs because it's undesirable to have the 1257 // base it on the actual number of tabs because it's undesirable to have the
1258 // minimum window size change when a new tab is opened. 1258 // minimum window size change when a new tab is opened.
1259 int needed_width; 1259 int needed_width;
1260 if (touch_layout_.get() || adjust_layout_) { 1260 if (touch_layout_.get() || adjust_layout_) {
1261 needed_width = Tab::GetTouchWidth() + 1261 needed_width = Tab::GetTouchWidth() +
1262 (2 * kStackedPadding * kMaxStackedCount); 1262 (2 * kStackedPadding * kMaxStackedCount);
1263 } else { 1263 } else {
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 else 2642 else
2643 RemoveMessageLoopObserver(); 2643 RemoveMessageLoopObserver();
2644 } 2644 }
2645 2645
2646 bool TabStrip::GetAdjustLayout() const { 2646 bool TabStrip::GetAdjustLayout() const {
2647 if (!adjust_layout_) 2647 if (!adjust_layout_)
2648 return false; 2648 return false;
2649 return chrome::GetHostDesktopTypeForNativeView( 2649 return chrome::GetHostDesktopTypeForNativeView(
2650 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH; 2650 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH;
2651 } 2651 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/task_manager_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698