OLD | NEW |
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/system/tray_caps_lock.h" | 5 #include "ash/system/tray_caps_lock.h" |
6 | 6 |
7 #include "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_views.h" | 11 #include "ash/system/tray/tray_views.h" |
11 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
12 #include "grit/ash_strings.h" | 13 #include "grit/ash_strings.h" |
13 #include "ui/base/accessibility/accessible_view_state.h" | 14 #include "ui/base/accessibility/accessible_view_state.h" |
14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
16 #include "ui/views/controls/image_view.h" | 17 #include "ui/views/controls/image_view.h" |
17 #include "ui/views/controls/label.h" | 18 #include "ui/views/controls/label.h" |
18 #include "ui/views/layout/box_layout.h" | 19 #include "ui/views/layout/box_layout.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Shell::GetInstance()->caps_lock_delegate()->ToggleCapsLock(); | 96 Shell::GetInstance()->caps_lock_delegate()->ToggleCapsLock(); |
96 return true; | 97 return true; |
97 } | 98 } |
98 | 99 |
99 views::Label* text_label_; | 100 views::Label* text_label_; |
100 views::Label* shortcut_label_; | 101 views::Label* shortcut_label_; |
101 | 102 |
102 DISALLOW_COPY_AND_ASSIGN(CapsLockDefaultView); | 103 DISALLOW_COPY_AND_ASSIGN(CapsLockDefaultView); |
103 }; | 104 }; |
104 | 105 |
105 TrayCapsLock::TrayCapsLock() | 106 TrayCapsLock::TrayCapsLock(SystemTray* system_tray) |
106 : TrayImageItem(IDR_AURA_UBER_TRAY_CAPS_LOCK), | 107 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_CAPS_LOCK), |
107 default_(NULL), | 108 default_(NULL), |
108 detailed_(NULL), | 109 detailed_(NULL), |
109 search_mapped_to_caps_lock_(false), | 110 search_mapped_to_caps_lock_(false), |
110 caps_lock_enabled_( | 111 caps_lock_enabled_( |
111 Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled()), | 112 Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled()), |
112 message_shown_(false) { | 113 message_shown_(false) { |
113 } | 114 } |
114 | 115 |
115 TrayCapsLock::~TrayCapsLock() {} | 116 TrayCapsLock::~TrayCapsLock() {} |
116 | 117 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 message_shown_ = true; | 179 message_shown_ = true; |
179 } | 180 } |
180 } else if (detailed_) { | 181 } else if (detailed_) { |
181 detailed_->GetWidget()->Close(); | 182 detailed_->GetWidget()->Close(); |
182 } | 183 } |
183 } | 184 } |
184 } | 185 } |
185 | 186 |
186 } // namespace internal | 187 } // namespace internal |
187 } // namespace ash | 188 } // namespace ash |
OLD | NEW |