| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_NATIVE_BUTTON_H__ | 5 #ifndef CHROME_VIEWS_NATIVE_BUTTON_H__ |
| 6 #define CHROME_VIEWS_NATIVE_BUTTON_H__ | 6 #define CHROME_VIEWS_NATIVE_BUTTON_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
| 11 #include "chrome/common/gfx/chrome_font.h" | 11 #include "chrome/common/gfx/chrome_font.h" |
| 12 #include "chrome/views/native_control.h" | 12 #include "chrome/views/native_control.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 | 15 |
| 16 class HWNDView; | |
| 17 | |
| 18 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 19 // | 17 // |
| 20 // NativeButton is a wrapper for a windows native button | 18 // NativeButton is a wrapper for a windows native button |
| 21 // TODO(beng): (Cleanup) this should derive also from some button-like base to | 19 // TODO(beng): (Cleanup) this should derive also from some button-like base to |
| 22 // get all the listenery-stuff for free and to work with | 20 // get all the listenery-stuff for free and to work with |
| 23 // AddManagedButton. | 21 // AddManagedButton. |
| 24 // | 22 // |
| 25 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
| 26 class NativeButton : public NativeControl { | 24 class NativeButton : public NativeControl { |
| 27 public: | 25 public: |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 private: | 111 private: |
| 114 NativeButton() {} | 112 NativeButton() {} |
| 115 | 113 |
| 116 // Initializes the button. If |is_default| is true, this appears like the | 114 // Initializes the button. If |is_default| is true, this appears like the |
| 117 // "default" button, and will register Enter as its keyboard accelerator. | 115 // "default" button, and will register Enter as its keyboard accelerator. |
| 118 void Init(const std::wstring& label, bool is_default); | 116 void Init(const std::wstring& label, bool is_default); |
| 119 | 117 |
| 120 void Clicked(); | 118 void Clicked(); |
| 121 | 119 |
| 122 // Whether the button preferred size should follow the Microsoft layout | 120 // Whether the button preferred size should follow the Microsoft layout |
| 123 // guidelines. Default is true. | 121 // guidelines. Default is true. |
| 124 bool enforce_dlu_min_size_; | 122 bool enforce_dlu_min_size_; |
| 125 | 123 |
| 126 std::wstring label_; | 124 std::wstring label_; |
| 127 ChromeFont font_; | 125 ChromeFont font_; |
| 128 Listener* listener_; | 126 Listener* listener_; |
| 129 | 127 |
| 130 CSize padding_; | 128 CSize padding_; |
| 131 | 129 |
| 132 // True if the button should be rendered to appear like the "default" button | 130 // True if the button should be rendered to appear like the "default" button |
| 133 // in the containing dialog box. Default buttons register Enter as their | 131 // in the containing dialog box. Default buttons register Enter as their |
| 134 // accelerator. | 132 // accelerator. |
| 135 bool is_default_; | 133 bool is_default_; |
| 136 | 134 |
| 137 // Minimum size, in dlus (see SetMinSizeFromDLUs). | 135 // Minimum size, in dlus (see SetMinSizeFromDLUs). |
| 138 gfx::Size min_dlu_size_; | 136 gfx::Size min_dlu_size_; |
| 139 | 137 |
| 140 // Storage of strings needed for accessibility. | 138 // Storage of strings needed for accessibility. |
| 141 std::wstring accessible_name_; | 139 std::wstring accessible_name_; |
| 142 | 140 |
| 143 DISALLOW_EVIL_CONSTRUCTORS(NativeButton); | 141 DISALLOW_COPY_AND_ASSIGN(NativeButton); |
| 144 }; | 142 }; |
| 145 | 143 |
| 146 } // namespace views | 144 } // namespace views |
| 147 | 145 |
| 148 #endif // CHROME_VIEWS_NATIVE_BUTTON_H__ | 146 #endif // CHROME_VIEWS_NATIVE_BUTTON_H__ |
| 149 | |
| OLD | NEW |