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

Side by Side Diff: chrome/browser/chromeos/status/input_method_menu_button.cc

Issue 7205027: Add accessible text to Language and clock buttons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code Review Created 9 years, 6 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 | « chrome/browser/chromeos/status/clock_menu_button.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/status/input_method_menu_button.h" 5 #include "chrome/browser/chromeos/status/input_method_menu_button.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 host_->GetScreenMode() == StatusAreaHost::kBrowserMode) { 126 host_->GetScreenMode() == StatusAreaHost::kBrowserMode) {
127 // As the disabled color is set to invisible, disabling makes the 127 // As the disabled color is set to invisible, disabling makes the
128 // button disappear. 128 // button disappear.
129 SetEnabled(false); 129 SetEnabled(false);
130 SetTooltipText(L""); // remove tooltip 130 SetTooltipText(L""); // remove tooltip
131 } else { 131 } else {
132 SetEnabled(true); 132 SetEnabled(true);
133 SetTooltipText(tooltip); 133 SetTooltipText(tooltip);
134 } 134 }
135 SetText(name); 135 SetText(name);
136 SetAccessibleName(WideToUTF16(tooltip));
136 137
137 if (WindowIsActive()) { 138 if (WindowIsActive()) {
138 // We don't call these functions if the |current_window| is not active since 139 // We don't call these functions if the |current_window| is not active since
139 // the calls are relatively expensive (crosbug.com/9206). Please note that 140 // the calls are relatively expensive (crosbug.com/9206). Please note that
140 // PrepareMenuModel() is necessary for fixing crosbug.com/7522 when the 141 // PrepareMenuModel() is necessary for fixing crosbug.com/7522 when the
141 // window is active. 142 // window is active.
142 menu_->PrepareMenuModel(); 143 menu_->PrepareMenuModel();
143 SchedulePaint(); 144 SchedulePaint();
144 } 145 }
145 146
(...skipping 16 matching lines...) Expand all
162 const input_method::InputMethodDescriptor& input_method = 163 const input_method::InputMethodDescriptor& input_method =
163 input_method_library->current_input_method(); 164 input_method_library->current_input_method();
164 const std::wstring name = InputMethodMenu::GetTextForIndicator(input_method); 165 const std::wstring name = InputMethodMenu::GetTextForIndicator(input_method);
165 const std::wstring tooltip = InputMethodMenu::GetTextForMenu(input_method); 166 const std::wstring tooltip = InputMethodMenu::GetTextForMenu(input_method);
166 const size_t num_active_input_methods = 167 const size_t num_active_input_methods =
167 input_method_library->GetNumActiveInputMethods(); 168 input_method_library->GetNumActiveInputMethods();
168 UpdateUI(input_method.id, name, tooltip, num_active_input_methods); 169 UpdateUI(input_method.id, name, tooltip, num_active_input_methods);
169 } 170 }
170 171
171 } // namespace chromeos 172 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/clock_menu_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698