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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.h

Issue 338263002: Change how the insertion point for tab drags is calculated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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.h » ('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 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // this tab. Only used for collecting UMA metrics. 92 // this tab. Only used for collecting UMA metrics.
93 // See ash/touch/touch_uma.cc. 93 // See ash/touch/touch_uma.cc.
94 bool tab_activated_with_last_gesture_begin() const { 94 bool tab_activated_with_last_gesture_begin() const {
95 return tab_activated_with_last_gesture_begin_; 95 return tab_activated_with_last_gesture_begin_;
96 } 96 }
97 97
98 views::GlowHoverController* hover_controller() { 98 views::GlowHoverController* hover_controller() {
99 return &hover_controller_; 99 return &hover_controller_;
100 } 100 }
101 101
102 // Returns the inset within the first dragged tab to use when calculating the
103 // "drag insertion point". If we simply used the x-coordinate of the tab,
104 // we'd be calculating based on a point well before where the user considers
105 // the tab to "be". The value here is chosen to "feel good" based on the
106 // widths of the tab images and the tab overlap.
107 //
108 // Note that this must return a value smaller than the midpoint of any tab's
109 // width, or else the user won't be able to drag a tab to the left of the
110 // first tab in the strip.
111 static int leading_width_for_drag() { return 16; }
112
102 // Returns the minimum possible size of a single unselected Tab. 113 // Returns the minimum possible size of a single unselected Tab.
103 static gfx::Size GetMinimumUnselectedSize(); 114 static gfx::Size GetMinimumUnselectedSize();
104 // Returns the minimum possible size of a selected Tab. Selected tabs must 115 // Returns the minimum possible size of a selected Tab. Selected tabs must
105 // always show a close button and have a larger minimum size than unselected 116 // always show a close button and have a larger minimum size than unselected
106 // tabs. 117 // tabs.
107 static gfx::Size GetMinimumSelectedSize(); 118 static gfx::Size GetMinimumSelectedSize();
108 // Returns the preferred size of a single Tab, assuming space is 119 // Returns the preferred size of a single Tab, assuming space is
109 // available. 120 // available.
110 static gfx::Size GetStandardSize(); 121 static gfx::Size GetStandardSize();
111 122
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 SkColor close_button_color_; 372 SkColor close_button_color_;
362 373
363 // As the majority of the tabs are inactive, and painting tabs is slowish, 374 // As the majority of the tabs are inactive, and painting tabs is slowish,
364 // we cache a handful of the inactive tab backgrounds here. 375 // we cache a handful of the inactive tab backgrounds here.
365 static ImageCache* image_cache_; 376 static ImageCache* image_cache_;
366 377
367 DISALLOW_COPY_AND_ASSIGN(Tab); 378 DISALLOW_COPY_AND_ASSIGN(Tab);
368 }; 379 };
369 380
370 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ 381 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698