OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/session/logout_button_tray.h" | 5 #include "ash/system/chromeos/session/logout_button_tray.h" |
6 | 6 |
7 #include "ash/shelf/shelf_types.h" | 7 #include "ash/shelf/shelf_types.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 9 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_notifier.h" | 12 #include "ash/system/tray/system_tray_notifier.h" |
13 #include "ash/system/tray/tray_constants.h" | 13 #include "ash/system/tray/tray_constants.h" |
14 #include "ash/system/tray/tray_utils.h" | 14 #include "ash/system/tray/tray_utils.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "grit/ash_resources.h" | 17 #include "grit/ash_resources.h" |
18 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
19 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
20 #include "ui/gfx/geometry/insets.h" | 20 #include "ui/gfx/geometry/insets.h" |
21 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
22 #include "ui/views/bubble/tray_bubble_view.h" | 22 #include "ui/views/bubble/tray_bubble_view.h" |
23 #include "ui/views/controls/button/label_button.h" | 23 #include "ui/views/controls/button/label_button.h" |
24 #include "ui/views/controls/button/label_button_border.h" | 24 #include "ui/views/controls/button/label_button_border.h" |
25 #include "ui/views/painter.h" | 25 #include "ui/views/painter.h" |
26 | 26 |
27 namespace ash { | 27 namespace ash { |
28 namespace internal { | |
29 | |
30 namespace { | 28 namespace { |
31 | 29 |
32 const int kLogoutButtonHorizontalExtraPadding = 7; | 30 const int kLogoutButtonHorizontalExtraPadding = 7; |
33 | 31 |
34 const int kLogoutButtonNormalImages[] = { | 32 const int kLogoutButtonNormalImages[] = { |
35 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP_LEFT, | 33 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP_LEFT, |
36 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP, | 34 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP, |
37 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP_RIGHT, | 35 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_TOP_RIGHT, |
38 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_LEFT, | 36 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_LEFT, |
39 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_CENTER, | 37 IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_CENTER, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 button_->SetAccessibleName(title); | 155 button_->SetAccessibleName(title); |
158 UpdateVisibility(); | 156 UpdateVisibility(); |
159 } | 157 } |
160 | 158 |
161 void LogoutButtonTray::UpdateVisibility() { | 159 void LogoutButtonTray::UpdateVisibility() { |
162 SetVisible(show_logout_button_in_tray_ && | 160 SetVisible(show_logout_button_in_tray_ && |
163 login_status_ != user::LOGGED_IN_NONE && | 161 login_status_ != user::LOGGED_IN_NONE && |
164 login_status_ != user::LOGGED_IN_LOCKED); | 162 login_status_ != user::LOGGED_IN_LOCKED); |
165 } | 163 } |
166 | 164 |
167 } // namespace internal | |
168 } // namespace ash | 165 } // namespace ash |
OLD | NEW |