| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "views/controls/button/native_button_win.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 #include <oleacc.h> | 8 #include <oleacc.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void NativeButtonWin::UpdateDefault() { | 64 void NativeButtonWin::UpdateDefault() { |
| 65 if (!IsCheckbox()) { | 65 if (!IsCheckbox()) { |
| 66 SendMessage(native_view(), BM_SETSTYLE, | 66 SendMessage(native_view(), BM_SETSTYLE, |
| 67 native_button_->is_default() ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON, | 67 native_button_->is_default() ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON, |
| 68 true); | 68 true); |
| 69 button_size_valid_ = false; | 69 button_size_valid_ = false; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 void NativeButtonWin::UpdateAccessibleName() { | 73 void NativeButtonWin::UpdateAccessibleName() { |
| 74 std::wstring name; | 74 string16 name; |
| 75 if (native_button_->GetAccessibleName(&name)) { | 75 if (native_button_->GetAccessibleName(&name)) { |
| 76 base::win::ScopedComPtr<IAccPropServices> pAccPropServices; | 76 base::win::ScopedComPtr<IAccPropServices> pAccPropServices; |
| 77 HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, | 77 HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, |
| 78 IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); | 78 IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); |
| 79 if (SUCCEEDED(hr)) { | 79 if (SUCCEEDED(hr)) { |
| 80 VARIANT var; | 80 VARIANT var; |
| 81 var.vt = VT_BSTR; | 81 var.vt = VT_BSTR; |
| 82 var.bstrVal = SysAllocString(name.c_str()); | 82 var.bstrVal = SysAllocString(name.c_str()); |
| 83 hr = pAccPropServices->SetHwndProp(native_view(), OBJID_WINDOW, | 83 hr = pAccPropServices->SetHwndProp(native_view(), OBJID_WINDOW, |
| 84 CHILDID_SELF, PROPID_ACC_NAME, var); | 84 CHILDID_SELF, PROPID_ACC_NAME, var); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return new NativeCheckboxWin(checkbox); | 275 return new NativeCheckboxWin(checkbox); |
| 276 } | 276 } |
| 277 | 277 |
| 278 // static | 278 // static |
| 279 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( | 279 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( |
| 280 RadioButton* radio_button) { | 280 RadioButton* radio_button) { |
| 281 return new NativeRadioButtonWin(radio_button); | 281 return new NativeRadioButtonWin(radio_button); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace views | 284 } // namespace views |
| OLD | NEW |