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

Side by Side Diff: views/controls/button/image_button.h

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 years, 9 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 | « views/controls/button/custom_button.cc ('k') | views/controls/button/menu_button.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) 2010 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 VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 5 #ifndef VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
6 #define VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 6 #define VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
7 #pragma once 7 #pragma once
8 8
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "views/controls/button/custom_button.h" 10 #include "views/controls/button/custom_button.h"
11 11
(...skipping 24 matching lines...) Expand all
36 36
37 enum VerticalAlignment { ALIGN_TOP = 0, 37 enum VerticalAlignment { ALIGN_TOP = 0,
38 ALIGN_MIDDLE, 38 ALIGN_MIDDLE,
39 ALIGN_BOTTOM }; 39 ALIGN_BOTTOM };
40 40
41 // Sets how the image is laid out within the button's bounds. 41 // Sets how the image is laid out within the button's bounds.
42 void SetImageAlignment(HorizontalAlignment h_align, 42 void SetImageAlignment(HorizontalAlignment h_align,
43 VerticalAlignment v_align); 43 VerticalAlignment v_align);
44 44
45 // Overridden from View: 45 // Overridden from View:
46 virtual gfx::Size GetPreferredSize(); 46 virtual gfx::Size GetPreferredSize() OVERRIDE;
47 virtual void OnPaint(gfx::Canvas* canvas); 47 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
48 48
49 // Sets preferred size, so it could be correctly positioned in layout even if 49 // Sets preferred size, so it could be correctly positioned in layout even if
50 // it is NULL. 50 // it is NULL.
51 void SetPreferredSize(const gfx::Size& preferred_size) { 51 void SetPreferredSize(const gfx::Size& preferred_size) {
52 preferred_size_ = preferred_size; 52 preferred_size_ = preferred_size;
53 } 53 }
54 54
55 protected: 55 protected:
56 // Returns the image to paint. This is invoked from paint and returns a value 56 // Returns the image to paint. This is invoked from paint and returns a value
57 // from images. 57 // from images.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // The parent class's tooltip_text_ is displayed when not toggled, and 113 // The parent class's tooltip_text_ is displayed when not toggled, and
114 // this one is shown when toggled. 114 // this one is shown when toggled.
115 string16 toggled_tooltip_text_; 115 string16 toggled_tooltip_text_;
116 116
117 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); 117 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton);
118 }; 118 };
119 119
120 } // namespace views 120 } // namespace views
121 121
122 #endif // VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 122 #endif // VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
OLDNEW
« no previous file with comments | « views/controls/button/custom_button.cc ('k') | views/controls/button/menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698