| 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/chromeos/network/tray_vpn.h" | 5 #include "ash/system/chromeos/network/tray_vpn.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/session/session_state_delegate.h" |
| 8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 9 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" | 10 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" |
| 10 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
| 11 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
| 12 #include "ash/system/tray/tray_constants.h" | 13 #include "ash/system/tray/tray_constants.h" |
| 13 #include "ash/system/tray/tray_item_more.h" | 14 #include "ash/system/tray/tray_item_more.h" |
| 14 #include "ash/system/tray/tray_popup_label_button.h" | 15 #include "ash/system/tray/tray_popup_label_button.h" |
| 15 #include "chromeos/network/network_state.h" | 16 #include "chromeos/network/network_state.h" |
| 16 #include "chromeos/network/network_state_handler.h" | 17 #include "chromeos/network/network_state_handler.h" |
| 17 #include "grit/ash_strings.h" | 18 #include "grit/ash_strings.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 118 |
| 118 views::View* TrayVPN::CreateDefaultView(user::LoginStatus status) { | 119 views::View* TrayVPN::CreateDefaultView(user::LoginStatus status) { |
| 119 CHECK(default_ == NULL); | 120 CHECK(default_ == NULL); |
| 120 if (!chromeos::NetworkHandler::IsInitialized()) | 121 if (!chromeos::NetworkHandler::IsInitialized()) |
| 121 return NULL; | 122 return NULL; |
| 122 if (status == user::LOGGED_IN_NONE) | 123 if (status == user::LOGGED_IN_NONE) |
| 123 return NULL; | 124 return NULL; |
| 124 if (!tray::VpnDefaultView::ShouldShow()) | 125 if (!tray::VpnDefaultView::ShouldShow()) |
| 125 return NULL; | 126 return NULL; |
| 126 | 127 |
| 127 default_ = new tray::VpnDefaultView(this, status != user::LOGGED_IN_LOCKED); | 128 bool userAddingRunning = ash::Shell::GetInstance() |
| 129 ->session_state_delegate() |
| 130 ->IsInSecondaryLoginScreen(); |
| 131 |
| 132 default_ = new tray::VpnDefaultView( |
| 133 this, status != user::LOGGED_IN_LOCKED && !userAddingRunning); |
| 134 |
| 128 return default_; | 135 return default_; |
| 129 } | 136 } |
| 130 | 137 |
| 131 views::View* TrayVPN::CreateDetailedView(user::LoginStatus status) { | 138 views::View* TrayVPN::CreateDetailedView(user::LoginStatus status) { |
| 132 CHECK(detailed_ == NULL); | 139 CHECK(detailed_ == NULL); |
| 133 if (!chromeos::NetworkHandler::IsInitialized()) | 140 if (!chromeos::NetworkHandler::IsInitialized()) |
| 134 return NULL; | 141 return NULL; |
| 135 | 142 |
| 136 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 143 Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 137 ash::UMA_STATUS_AREA_DETAILED_VPN_VIEW); | 144 ash::UMA_STATUS_AREA_DETAILED_VPN_VIEW); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 168 detailed_->ManagerChanged(); | 175 detailed_->ManagerChanged(); |
| 169 } | 176 } |
| 170 } | 177 } |
| 171 | 178 |
| 172 void TrayVPN::NetworkServiceChanged(const chromeos::NetworkState* network) { | 179 void TrayVPN::NetworkServiceChanged(const chromeos::NetworkState* network) { |
| 173 if (detailed_) | 180 if (detailed_) |
| 174 detailed_->NetworkServiceChanged(network); | 181 detailed_->NetworkServiceChanged(network); |
| 175 } | 182 } |
| 176 | 183 |
| 177 } // namespace ash | 184 } // namespace ash |
| OLD | NEW |