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

Side by Side Diff: ash/common/system/chromeos/tray_caps_lock.cc

Issue 2738133003: Promotes a handful of members from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/common/system/chromeos/tray_caps_lock.h" 5 #include "ash/common/system/chromeos/tray_caps_lock.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/system/tray/actionable_view.h" 8 #include "ash/common/system/tray/actionable_view.h"
9 #include "ash/common/system/tray/system_tray_delegate.h" 9 #include "ash/common/system/tray/system_tray_delegate.h"
10 #include "ash/common/system/tray/tray_constants.h" 10 #include "ash/common/system/tray/tray_constants.h"
11 #include "ash/common/system/tray/tray_popup_item_style.h" 11 #include "ash/common/system/tray/tray_popup_item_style.h"
12 #include "ash/common/system/tray/tray_popup_utils.h" 12 #include "ash/common/system/tray/tray_popup_utils.h"
13 #include "ash/common/system/tray/tri_view.h" 13 #include "ash/common/system/tray/tri_view.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "ash/resources/grit/ash_resources.h" 15 #include "ash/resources/grit/ash_resources.h"
16 #include "ash/resources/vector_icons/vector_icons.h" 16 #include "ash/resources/vector_icons/vector_icons.h"
17 #include "ash/shell.h"
17 #include "ash/strings/grit/ash_strings.h" 18 #include "ash/strings/grit/ash_strings.h"
18 #include "base/sys_info.h" 19 #include "base/sys_info.h"
19 #include "ui/accessibility/ax_node_data.h" 20 #include "ui/accessibility/ax_node_data.h"
20 #include "ui/base/ime/chromeos/ime_keyboard.h" 21 #include "ui/base/ime/chromeos/ime_keyboard.h"
21 #include "ui/base/ime/chromeos/input_method_manager.h" 22 #include "ui/base/ime/chromeos/input_method_manager.h"
22 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/gfx/image/image.h" 25 #include "ui/gfx/image/image.h"
25 #include "ui/gfx/paint_vector_icon.h" 26 #include "ui/gfx/paint_vector_icon.h"
26 #include "ui/views/border.h" 27 #include "ui/views/border.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 chromeos::input_method::InputMethodManager* ime = 152 chromeos::input_method::InputMethodManager* ime =
152 chromeos::input_method::InputMethodManager::Get(); 153 chromeos::input_method::InputMethodManager::Get();
153 if (ime && ime->GetImeKeyboard()) 154 if (ime && ime->GetImeKeyboard())
154 ime->GetImeKeyboard()->RemoveObserver(this); 155 ime->GetImeKeyboard()->RemoveObserver(this);
155 } 156 }
156 157
157 void TrayCapsLock::OnCapsLockChanged(bool enabled) { 158 void TrayCapsLock::OnCapsLockChanged(bool enabled) {
158 caps_lock_enabled_ = enabled; 159 caps_lock_enabled_ = enabled;
159 160
160 // Send an a11y alert. 161 // Send an a11y alert.
161 WmShell::Get()->accessibility_delegate()->TriggerAccessibilityAlert( 162 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
162 enabled ? A11Y_ALERT_CAPS_ON : A11Y_ALERT_CAPS_OFF); 163 enabled ? A11Y_ALERT_CAPS_ON : A11Y_ALERT_CAPS_OFF);
163 164
164 if (tray_view()) 165 if (tray_view())
165 tray_view()->SetVisible(caps_lock_enabled_); 166 tray_view()->SetVisible(caps_lock_enabled_);
166 167
167 if (default_) { 168 if (default_) {
168 default_->Update(caps_lock_enabled_); 169 default_->Update(caps_lock_enabled_);
169 } else { 170 } else {
170 if (caps_lock_enabled_) { 171 if (caps_lock_enabled_) {
171 if (!message_shown_) { 172 if (!message_shown_) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 224
224 void TrayCapsLock::DestroyDefaultView() { 225 void TrayCapsLock::DestroyDefaultView() {
225 default_ = nullptr; 226 default_ = nullptr;
226 } 227 }
227 228
228 void TrayCapsLock::DestroyDetailedView() { 229 void TrayCapsLock::DestroyDetailedView() {
229 detailed_ = nullptr; 230 detailed_ = nullptr;
230 } 231 }
231 232
232 } // namespace ash 233 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/tools/screenshot_unittest.cc ('k') | ash/common/system/ime/tray_ime_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698