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

Side by Side Diff: views/controls/button/native_button.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/menu_button.cc ('k') | views/controls/button/native_button_win.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.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // 73 //
74 // In order to overcome this problem, we mark the localized Hebrew strings as 74 // In order to overcome this problem, we mark the localized Hebrew strings as
75 // RTL strings explicitly (using the appropriate Unicode formatting) so that 75 // RTL strings explicitly (using the appropriate Unicode formatting) so that
76 // Windows displays the text correctly regardless of the HWND hierarchy. 76 // Windows displays the text correctly regardless of the HWND hierarchy.
77 base::i18n::AdjustStringForLocaleDirection(&label_); 77 base::i18n::AdjustStringForLocaleDirection(&label_);
78 78
79 if (native_wrapper_) 79 if (native_wrapper_)
80 native_wrapper_->UpdateLabel(); 80 native_wrapper_->UpdateLabel();
81 81
82 // Update the accessible name whenever the label changes. 82 // Update the accessible name whenever the label changes.
83 SetAccessibleName(label); 83 SetAccessibleName(WideToUTF16Hack(label));
84 PreferredSizeChanged(); 84 PreferredSizeChanged();
85 } 85 }
86 86
87 void NativeButton::SetIsDefault(bool is_default) { 87 void NativeButton::SetIsDefault(bool is_default) {
88 if (is_default == is_default_) 88 if (is_default == is_default_)
89 return; 89 return;
90 is_default_ = is_default; 90 is_default_ = is_default;
91 if (is_default_) 91 if (is_default_)
92 AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); 92 AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false));
93 else 93 else
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 native_wrapper->UpdateEnabled(); 225 native_wrapper->UpdateEnabled();
226 return native_wrapper; 226 return native_wrapper;
227 } 227 }
228 228
229 void NativeButton::InitBorder() { 229 void NativeButton::InitBorder() {
230 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0, 230 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0,
231 kButtonBorderHWidth)); 231 kButtonBorderHWidth));
232 } 232 }
233 233
234 } // namespace views 234 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/menu_button.cc ('k') | views/controls/button/native_button_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698