| OLD | NEW |
| 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_win.h" | 5 #include "chrome/views/controls/button/native_button_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/views/controls/button/checkbox.h" | 8 #include "chrome/views/controls/button/checkbox.h" |
| 9 #include "chrome/views/controls/button/native_button.h" | 9 #include "chrome/views/controls/button/native_button.h" |
| 10 #include "chrome/views/controls/button/radio_button.h" | 10 #include "chrome/views/controls/button/radio_button.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void NativeButtonWin::UpdateLabel() { | 33 void NativeButtonWin::UpdateLabel() { |
| 34 SetWindowText(GetHWND(), native_button_->label().c_str()); | 34 SetWindowText(GetHWND(), native_button_->label().c_str()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void NativeButtonWin::UpdateFont() { | 37 void NativeButtonWin::UpdateFont() { |
| 38 SendMessage(GetHWND(), WM_SETFONT, | 38 SendMessage(GetHWND(), WM_SETFONT, |
| 39 reinterpret_cast<WPARAM>(native_button_->font().hfont()), | 39 reinterpret_cast<WPARAM>(native_button_->font().hfont()), |
| 40 FALSE); | 40 FALSE); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void NativeButtonWin::UpdateEnabled() { |
| 44 SetEnabled(native_button_->IsEnabled()); |
| 45 } |
| 46 |
| 43 void NativeButtonWin::UpdateDefault() { | 47 void NativeButtonWin::UpdateDefault() { |
| 44 if (!IsCheckbox()) { | 48 if (!IsCheckbox()) { |
| 45 SendMessage(GetHWND(), BM_SETSTYLE, | 49 SendMessage(GetHWND(), BM_SETSTYLE, |
| 46 native_button_->is_default() ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON, | 50 native_button_->is_default() ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON, |
| 47 true); | 51 true); |
| 48 } | 52 } |
| 49 } | 53 } |
| 50 | 54 |
| 51 View* NativeButtonWin::GetView() { | 55 View* NativeButtonWin::GetView() { |
| 52 return this; | 56 return this; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 return new NativeCheckboxWin(checkbox); | 227 return new NativeCheckboxWin(checkbox); |
| 224 } | 228 } |
| 225 | 229 |
| 226 // static | 230 // static |
| 227 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( | 231 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( |
| 228 RadioButton* radio_button) { | 232 RadioButton* radio_button) { |
| 229 return new NativeRadioButtonWin(radio_button); | 233 return new NativeRadioButtonWin(radio_button); |
| 230 } | 234 } |
| 231 | 235 |
| 232 } // namespace views | 236 } // namespace views |
| OLD | NEW |