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

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

Issue 45042: Fix for native button focus bug (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/views/controls/button/native_button.h" 5 #include "chrome/views/controls/button/native_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/common/l10n_util.h" 8 #include "chrome/common/l10n_util.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 bool NativeButton::AcceleratorPressed(const Accelerator& accelerator) { 133 bool NativeButton::AcceleratorPressed(const Accelerator& accelerator) {
134 if (IsEnabled()) { 134 if (IsEnabled()) {
135 NotifyClick(mouse_event_flags()); 135 NotifyClick(mouse_event_flags());
136 return true; 136 return true;
137 } 137 }
138 return false; 138 return false;
139 } 139 }
140 140
141 void NativeButton::Focus() {
142 Button::Focus();
143 // Forward the focus to the wrapper.
144 if (native_wrapper_)
145 native_wrapper_->SetFocus();
146 }
147
141 //////////////////////////////////////////////////////////////////////////////// 148 ////////////////////////////////////////////////////////////////////////////////
142 // NativeButton, protected: 149 // NativeButton, protected:
143 150
144 void NativeButton::CreateWrapper() { 151 void NativeButton::CreateWrapper() {
145 native_wrapper_ = NativeButtonWrapper::CreateNativeButtonWrapper(this); 152 native_wrapper_ = NativeButtonWrapper::CreateNativeButtonWrapper(this);
146 native_wrapper_->UpdateLabel(); 153 native_wrapper_->UpdateLabel();
147 } 154 }
148 155
149 void NativeButton::InitBorder() { 156 void NativeButton::InitBorder() {
150 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0, 157 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0,
151 kButtonBorderHWidth)); 158 kButtonBorderHWidth));
152 } 159 }
153 160
154 } // namespace views 161 } // namespace views
OLDNEW
« no previous file with comments | « chrome/views/controls/button/native_button.h ('k') | chrome/views/controls/button/native_button_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698