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

Side by Side Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.h

Issue 25039002: Always aligns text at vertically center (Textfield, Label). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 years, 1 month 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_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 16 matching lines...) Expand all
27 // 27 //
28 // Internally KeywordHintView uses two labels to render the text, and draws 28 // Internally KeywordHintView uses two labels to render the text, and draws
29 // the tab image itself. 29 // the tab image itself.
30 // 30 //
31 // NOTE: This should really be called LocationBarKeywordHintView, but I 31 // NOTE: This should really be called LocationBarKeywordHintView, but I
32 // couldn't bring myself to use such a long name. 32 // couldn't bring myself to use such a long name.
33 class KeywordHintView : public views::View { 33 class KeywordHintView : public views::View {
34 public: 34 public:
35 KeywordHintView(Profile* profile, 35 KeywordHintView(Profile* profile,
36 const gfx::FontList& font_list, 36 const gfx::FontList& font_list,
37 int font_y_offset,
38 SkColor text_color, 37 SkColor text_color,
39 SkColor background_color); 38 SkColor background_color);
40 virtual ~KeywordHintView(); 39 virtual ~KeywordHintView();
41 40
42 void SetKeyword(const string16& keyword); 41 void SetKeyword(const string16& keyword);
43 string16 keyword() const { return keyword_; } 42 string16 keyword() const { return keyword_; }
44 43
45 virtual gfx::Size GetPreferredSize() OVERRIDE; 44 virtual gfx::Size GetPreferredSize() OVERRIDE;
46 // The minimum size is just big enough to show the tab. 45 // The minimum size is just big enough to show the tab.
47 virtual gfx::Size GetMinimumSize() OVERRIDE; 46 virtual gfx::Size GetMinimumSize() OVERRIDE;
48 virtual void Layout() OVERRIDE; 47 virtual void Layout() OVERRIDE;
49 48
50 private: 49 private:
51 views::Label* CreateLabel(const gfx::FontList& font_list, 50 views::Label* CreateLabel(const gfx::FontList& font_list,
52 int font_y_offset,
53 SkColor text_color, 51 SkColor text_color,
54 SkColor background_color); 52 SkColor background_color);
55 53
56 Profile* profile_; 54 Profile* profile_;
57 views::Label* leading_label_; 55 views::Label* leading_label_;
58 views::ImageView* tab_image_; 56 views::ImageView* tab_image_;
59 views::Label* trailing_label_; 57 views::Label* trailing_label_;
60 string16 keyword_; 58 string16 keyword_;
61 59
62 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); 60 DISALLOW_COPY_AND_ASSIGN(KeywordHintView);
63 }; 61 };
64 62
65 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 63 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698