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

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: Add two more const for Windows. 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
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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 1246
1247 // If the active tab is being dragged, it goes last. 1247 // If the active tab is being dragged, it goes last.
1248 if (active_tab && is_dragging) 1248 if (active_tab && is_dragging)
1249 active_tab->Paint(canvas, cull_set); 1249 active_tab->Paint(canvas, cull_set);
1250 } 1250 }
1251 1251
1252 const char* TabStrip::GetClassName() const { 1252 const char* TabStrip::GetClassName() const {
1253 return kViewClassName; 1253 return kViewClassName;
1254 } 1254 }
1255 1255
1256 gfx::Size TabStrip::GetPreferredSize() { 1256 gfx::Size TabStrip::GetPreferredSize() const {
1257 // For stacked tabs the minimum size is calculated as the size needed to 1257 // For stacked tabs the minimum size is calculated as the size needed to
1258 // handle showing any number of tabs. Otherwise report the minimum width as 1258 // handle showing any number of tabs. Otherwise report the minimum width as
1259 // the size required for a single selected tab plus the new tab button. Don't 1259 // the size required for a single selected tab plus the new tab button. Don't
1260 // base it on the actual number of tabs because it's undesirable to have the 1260 // base it on the actual number of tabs because it's undesirable to have the
1261 // minimum window size change when a new tab is opened. 1261 // minimum window size change when a new tab is opened.
1262 int needed_width; 1262 int needed_width;
1263 if (touch_layout_.get() || adjust_layout_) { 1263 if (touch_layout_.get() || adjust_layout_) {
1264 needed_width = Tab::GetTouchWidth() + 1264 needed_width = Tab::GetTouchWidth() +
1265 (2 * kStackedPadding * kMaxStackedCount); 1265 (2 * kStackedPadding * kMaxStackedCount);
1266 } else { 1266 } else {
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2646 else 2646 else
2647 RemoveMessageLoopObserver(); 2647 RemoveMessageLoopObserver();
2648 } 2648 }
2649 2649
2650 bool TabStrip::GetAdjustLayout() const { 2650 bool TabStrip::GetAdjustLayout() const {
2651 if (!adjust_layout_) 2651 if (!adjust_layout_)
2652 return false; 2652 return false;
2653 return chrome::GetHostDesktopTypeForNativeView( 2653 return chrome::GetHostDesktopTypeForNativeView(
2654 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH; 2654 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH;
2655 } 2655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698