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

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

Issue 6192007: Remove wstring from views. Part 3: Switch accessibility strings to string16.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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.cc ('k') | views/controls/button/text_button.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « views/controls/button/native_button.cc ('k') | views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698