| 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/logout_button/tray_logout_button.h" | 5 #include "ash/system/logout_button/tray_logout_button.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/tray/system_tray.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
| 11 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/string16.h" | 14 #include "base/string16.h" |
| 14 #include "grit/ash_resources.h" | 15 #include "grit/ash_resources.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/views/controls/button/border_images.h" | 17 #include "ui/views/controls/button/border_images.h" |
| 17 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 18 #include "ui/views/controls/button/custom_button.h" | 19 #include "ui/views/controls/button/custom_button.h" |
| 19 #include "ui/views/controls/button/label_button.h" | 20 #include "ui/views/controls/button/label_button.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 110 } |
| 110 | 111 |
| 111 user::LoginStatus login_status_; | 112 user::LoginStatus login_status_; |
| 112 bool show_logout_button_in_tray_; | 113 bool show_logout_button_in_tray_; |
| 113 | 114 |
| 114 DISALLOW_COPY_AND_ASSIGN(LogoutButton); | 115 DISALLOW_COPY_AND_ASSIGN(LogoutButton); |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace tray | 118 } // namespace tray |
| 118 | 119 |
| 119 TrayLogoutButton::TrayLogoutButton() : logout_button_(NULL) { | 120 TrayLogoutButton::TrayLogoutButton(SystemTray* system_tray) |
| 121 : SystemTrayItem(system_tray), |
| 122 logout_button_(NULL) { |
| 120 } | 123 } |
| 121 | 124 |
| 122 views::View* TrayLogoutButton::CreateTrayView(user::LoginStatus status) { | 125 views::View* TrayLogoutButton::CreateTrayView(user::LoginStatus status) { |
| 123 CHECK(logout_button_ == NULL); | 126 CHECK(logout_button_ == NULL); |
| 124 logout_button_ = new tray::LogoutButton(status); | 127 logout_button_ = new tray::LogoutButton(status); |
| 125 return logout_button_; | 128 return logout_button_; |
| 126 } | 129 } |
| 127 | 130 |
| 128 void TrayLogoutButton::DestroyTrayView() { | 131 void TrayLogoutButton::DestroyTrayView() { |
| 129 logout_button_ = NULL; | 132 logout_button_ = NULL; |
| 130 } | 133 } |
| 131 | 134 |
| 132 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 135 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 133 logout_button_->OnLoginStatusChanged(status); | 136 logout_button_->OnLoginStatusChanged(status); |
| 134 } | 137 } |
| 135 | 138 |
| 136 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { | 139 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { |
| 137 logout_button_->OnShowLogoutButtonInTrayChanged(show); | 140 logout_button_->OnShowLogoutButtonInTrayChanged(show); |
| 138 } | 141 } |
| 139 | 142 |
| 140 } // namespace internal | 143 } // namespace internal |
| 141 } // namespace ash | 144 } // namespace ash |
| OLD | NEW |