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

Side by Side Diff: ui/views/controls/button/menu_button.h

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 7 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) 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_BUTTON_MENU_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const gfx::Point& menu_offset() const { return menu_offset_; } 47 const gfx::Point& menu_offset() const { return menu_offset_; }
48 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); } 48 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); }
49 49
50 // Activate the button (called when the button is pressed). 50 // Activate the button (called when the button is pressed).
51 virtual bool Activate(); 51 virtual bool Activate();
52 52
53 // Overridden from TextButton for the potential use of a drop marker. 53 // Overridden from TextButton for the potential use of a drop marker.
54 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; 54 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE;
55 55
56 // Overridden from View: 56 // Overridden from View:
57 virtual gfx::Size GetPreferredSize() OVERRIDE; 57 virtual gfx::Size GetPreferredSize() const OVERRIDE;
58 virtual const char* GetClassName() const OVERRIDE; 58 virtual const char* GetClassName() const OVERRIDE;
59 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 59 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
60 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 60 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
61 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; 61 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
62 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 62 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
63 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 63 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
64 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; 64 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
65 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; 65 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
66 66
67 protected: 67 protected:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // If non-null the destuctor sets this to true. This is set while the menu is 102 // If non-null the destuctor sets this to true. This is set while the menu is
103 // showing and used to detect if the menu was deleted while running. 103 // showing and used to detect if the menu was deleted while running.
104 bool* destroyed_flag_; 104 bool* destroyed_flag_;
105 105
106 DISALLOW_COPY_AND_ASSIGN(MenuButton); 106 DISALLOW_COPY_AND_ASSIGN(MenuButton);
107 }; 107 };
108 108
109 } // namespace views 109 } // namespace views
110 110
111 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ 111 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698