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

Side by Side Diff: views/controls/button/native_button.cc

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DisableOnHover test? Created 9 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
« no previous file with comments | « views/controls/button/native_button.h ('k') | views/controls/button/text_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) 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 #include "views/controls/button/native_button.h" 5 #include "views/controls/button/native_button.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "ui/base/keycodes/keyboard_codes.h" 8 #include "ui/base/keycodes/keyboard_codes.h"
9 #include "views/controls/native/native_view_host.h" 9 #include "views/controls/native/native_view_host.h"
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return sz; 157 return sz;
158 } 158 }
159 159
160 void NativeButtonBase::Layout() { 160 void NativeButtonBase::Layout() {
161 if (native_wrapper_) { 161 if (native_wrapper_) {
162 native_wrapper_->GetView()->SetBounds(0, 0, width(), height()); 162 native_wrapper_->GetView()->SetBounds(0, 0, width(), height());
163 native_wrapper_->GetView()->Layout(); 163 native_wrapper_->GetView()->Layout();
164 } 164 }
165 } 165 }
166 166
167 void NativeButtonBase::SetEnabled(bool flag) { 167 void NativeButtonBase::OnEnabledChanged() {
168 Button::SetEnabled(flag); 168 Button::OnEnabledChanged();
169 if (native_wrapper_) 169 if (native_wrapper_)
170 native_wrapper_->UpdateEnabled(); 170 native_wrapper_->UpdateEnabled();
171 } 171 }
172 172
173 void NativeButtonBase::ViewHierarchyChanged(bool is_add, View* parent, 173 void NativeButtonBase::ViewHierarchyChanged(bool is_add, View* parent,
174 View* child) { 174 View* child) {
175 if (is_add && !native_wrapper_ && GetWidget()) { 175 if (is_add && !native_wrapper_ && GetWidget()) {
176 // The native wrapper's lifetime will be managed by the view hierarchy after 176 // The native wrapper's lifetime will be managed by the view hierarchy after
177 // we call AddChildView. 177 // we call AddChildView.
178 native_wrapper_ = CreateWrapper(); 178 native_wrapper_ = CreateWrapper();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label) 281 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label)
282 : NativeButtonBase(listener, label) { 282 : NativeButtonBase(listener, label) {
283 } 283 }
284 284
285 NativeButton::~NativeButton() { 285 NativeButton::~NativeButton() {
286 } 286 }
287 #endif 287 #endif
288 288
289 } // namespace views 289 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/native_button.h ('k') | views/controls/button/text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698