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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 text_label_->SetSize(gfx::Size(text_size.width() + new_x - old_x, | 77 text_label_->SetSize(gfx::Size(text_size.width() + new_x - old_x, |
78 text_size.height())); | 78 text_size.height())); |
79 } | 79 } |
80 | 80 |
81 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { | 81 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { |
82 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 82 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
83 state->name = text_label_->text(); | 83 state->name = text_label_->text(); |
84 } | 84 } |
85 | 85 |
86 // Overridden from ActionableView: | 86 // Overridden from ActionableView: |
87 virtual bool PerformAction(const views::Event& event) OVERRIDE { | 87 virtual bool PerformAction(const ui::Event& event) OVERRIDE { |
88 Shell::GetInstance()->tray_delegate()->SetCapsLockEnabled( | 88 Shell::GetInstance()->tray_delegate()->SetCapsLockEnabled( |
89 !Shell::GetInstance()->tray_delegate()->IsCapsLockOn()); | 89 !Shell::GetInstance()->tray_delegate()->IsCapsLockOn()); |
90 return true; | 90 return true; |
91 } | 91 } |
92 | 92 |
93 views::Label* text_label_; | 93 views::Label* text_label_; |
94 views::Label* shortcut_label_; | 94 views::Label* shortcut_label_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(CapsLockDefaultView); | 96 DISALLOW_COPY_AND_ASSIGN(CapsLockDefaultView); |
97 }; | 97 }; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 message_shown_ = true; | 172 message_shown_ = true; |
173 } | 173 } |
174 } else if (detailed_) { | 174 } else if (detailed_) { |
175 detailed_->GetWidget()->Close(); | 175 detailed_->GetWidget()->Close(); |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace internal | 180 } // namespace internal |
181 } // namespace ash | 181 } // namespace ash |
OLD | NEW |