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

Side by Side Diff: ui/views/controls/link.h

Issue 111023004: Add GetMinimumSize() for Labels and ensure it's zero for empty Links. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 | « ui/views/controls/label.cc ('k') | ui/views/controls/link.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 #ifndef UI_VIEWS_CONTROLS_LINK_H_ 5 #ifndef UI_VIEWS_CONTROLS_LINK_H_
6 #define UI_VIEWS_CONTROLS_LINK_H_ 6 #define UI_VIEWS_CONTROLS_LINK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 15 matching lines...) Expand all
26 public: 26 public:
27 Link(); 27 Link();
28 explicit Link(const string16& title); 28 explicit Link(const string16& title);
29 virtual ~Link(); 29 virtual ~Link();
30 30
31 static SkColor GetDefaultEnabledColor(); 31 static SkColor GetDefaultEnabledColor();
32 32
33 const LinkListener* listener() { return listener_; } 33 const LinkListener* listener() { return listener_; }
34 void set_listener(LinkListener* listener) { listener_ = listener; } 34 void set_listener(LinkListener* listener) { listener_ = listener; }
35 35
36 // Overridden from View: 36 // Label:
37 virtual void OnEnabledChanged() OVERRIDE;
38 virtual const char* GetClassName() const OVERRIDE; 37 virtual const char* GetClassName() const OVERRIDE;
39 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; 38 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
40 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
41 virtual void OnFocus() OVERRIDE;
42 virtual void OnBlur() OVERRIDE;
43 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; 39 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
44 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 40 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
45 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; 41 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
46 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 42 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
47 virtual void OnMouseCaptureLost() OVERRIDE; 43 virtual void OnMouseCaptureLost() OVERRIDE;
48 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 44 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
45 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
49 virtual bool SkipDefaultKeyEventProcessing( 46 virtual bool SkipDefaultKeyEventProcessing(
50 const ui::KeyEvent& event) OVERRIDE; 47 const ui::KeyEvent& event) OVERRIDE;
51 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 48 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
49 virtual void OnEnabledChanged() OVERRIDE;
50 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
51 virtual void OnFocus() OVERRIDE;
52 virtual void OnBlur() OVERRIDE;
53 virtual void SetFont(const gfx::Font& font) OVERRIDE;
54 virtual void SetText(const string16& text) OVERRIDE;
55 virtual void SetEnabledColor(SkColor color) OVERRIDE;
52 56
53 // Overridden from ui::EventHandler:
54 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
55
56 // Overridden from Label:
57 virtual void SetFont(const gfx::Font& font) OVERRIDE;
58
59 virtual void SetEnabledColor(SkColor color) OVERRIDE;
60 void SetPressedColor(SkColor color); 57 void SetPressedColor(SkColor color);
61 void SetUnderline(bool underline); 58 void SetUnderline(bool underline);
62 59
63 static const char kViewClassName[]; 60 static const char kViewClassName[];
64 61
65 private: 62 private:
66 void Init(); 63 void Init();
67 64
68 void SetPressed(bool pressed); 65 void SetPressed(bool pressed);
69 66
(...skipping 12 matching lines...) Expand all
82 79
83 // The color when the link is pressed. 80 // The color when the link is pressed.
84 SkColor requested_pressed_color_; 81 SkColor requested_pressed_color_;
85 82
86 DISALLOW_COPY_AND_ASSIGN(Link); 83 DISALLOW_COPY_AND_ASSIGN(Link);
87 }; 84 };
88 85
89 } // namespace views 86 } // namespace views
90 87
91 #endif // UI_VIEWS_CONTROLS_LINK_H_ 88 #endif // UI_VIEWS_CONTROLS_LINK_H_
OLDNEW
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/link.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698