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

Side by Side Diff: chrome/browser/ui/touch/tabs/touch_tab.h

Issue 7065052: Improve large tab strip by leveraging touch icons when present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_TOUCH_TABS_TOUCH_TAB_H_ 5 #ifndef CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_H_
6 #define CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_H_ 6 #define CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 explicit TouchTab(TabController* controller); 28 explicit TouchTab(TabController* controller);
29 virtual ~TouchTab(); 29 virtual ~TouchTab();
30 30
31 // Set the background offset used to match the image in the inactive tab 31 // Set the background offset used to match the image in the inactive tab
32 // to the frame image. 32 // to the frame image.
33 void set_background_offset(const gfx::Point& offset) { 33 void set_background_offset(const gfx::Point& offset) {
34 background_offset_ = offset; 34 background_offset_ = offset;
35 } 35 }
36 36
37 // get and set touch icon
38 void set_touch_icon(const SkBitmap& bitmap) {
39 touch_icon_ = bitmap;
40 }
41 const SkBitmap& get_touch_icon() {
sky 2011/06/16 15:43:41 For getters like this the name should match the fi
Emmanuel Saint-loubert-Bié 2011/06/17 00:01:44 Done.
42 return touch_icon_;
43 }
44
37 // Returns the minimum possible size of a single unselected Tab. 45 // Returns the minimum possible size of a single unselected Tab.
38 static gfx::Size GetMinimumUnselectedSize(); 46 static gfx::Size GetMinimumUnselectedSize();
39 47
40 protected: 48 protected:
41 virtual const gfx::Rect& GetTitleBounds() const; 49 virtual const gfx::Rect& GetTitleBounds() const;
42 virtual const gfx::Rect& GetIconBounds() const; 50 virtual const gfx::Rect& GetIconBounds() const;
43 51
44 private: 52 private:
45 // Overridden from views::View: 53 // Overridden from views::View:
46 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 54 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
(...skipping 20 matching lines...) Expand all
67 75
68 // the bounds of the title text 76 // the bounds of the title text
69 gfx::Rect title_bounds_; 77 gfx::Rect title_bounds_;
70 78
71 // the bounds of the favicon 79 // the bounds of the favicon
72 gfx::Rect favicon_bounds_; 80 gfx::Rect favicon_bounds_;
73 81
74 // The offset used to paint the inactive background image. 82 // The offset used to paint the inactive background image.
75 gfx::Point background_offset_; 83 gfx::Point background_offset_;
76 84
85 // The touch icon found
86 SkBitmap touch_icon_;
87
77 // 'l' is for left 88 // 'l' is for left
78 // 'c' is for center 89 // 'c' is for center
79 // 'r' is for right 90 // 'r' is for right
80 struct TouchTabImage { 91 struct TouchTabImage {
81 SkBitmap* image_l; 92 SkBitmap* image_l;
82 SkBitmap* image_c; 93 SkBitmap* image_c;
83 SkBitmap* image_r; 94 SkBitmap* image_r;
84 int l_width; 95 int l_width;
85 int r_width; 96 int r_width;
86 int y_offset; 97 int y_offset;
87 }; 98 };
88 static TouchTabImage tab_active; 99 static TouchTabImage tab_active;
89 static TouchTabImage tab_inactive; 100 static TouchTabImage tab_inactive;
90 static TouchTabImage tab_alpha; 101 static TouchTabImage tab_alpha;
91 102
92 DISALLOW_COPY_AND_ASSIGN(TouchTab); 103 DISALLOW_COPY_AND_ASSIGN(TouchTab);
93 }; 104 };
94 105
95 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_H_ 106 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698