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_network.h" | 5 #include "ash/system/chromeos/network/tray_network.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/metrics/user_metrics_recorder.h" |
9 #include "ash/shelf/shelf_util.h" | 9 #include "ash/shelf/shelf_util.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const NetworkState* connected_network = | 84 const NetworkState* connected_network = |
85 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); | 85 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); |
86 if (connected_network) { | 86 if (connected_network) { |
87 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), | 87 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), |
88 true); | 88 true); |
89 } else { | 89 } else { |
90 UpdateConnectionStatus(base::string16(), false); | 90 UpdateConnectionStatus(base::string16(), false); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void UpdateAlignment(ShelfAlignment alignment) { | 94 void UpdateAlignment(wm::ShelfAlignment alignment) { |
95 SetLayoutManager(new views::BoxLayout(IsHorizontalAlignment(alignment) | 95 SetLayoutManager(new views::BoxLayout(IsHorizontalAlignment(alignment) |
96 ? views::BoxLayout::kHorizontal | 96 ? views::BoxLayout::kHorizontal |
97 : views::BoxLayout::kVertical, | 97 : views::BoxLayout::kVertical, |
98 0, 0, 0)); | 98 0, 0, 0)); |
99 Layout(); | 99 Layout(); |
100 } | 100 } |
101 | 101 |
102 // views::View override. | 102 // views::View override. |
103 void GetAccessibleState(ui::AXViewState* state) override { | 103 void GetAccessibleState(ui::AXViewState* state) override { |
104 state->name = connection_status_string_; | 104 state->name = connection_status_string_; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 default_ = NULL; | 296 default_ = NULL; |
297 } | 297 } |
298 | 298 |
299 void TrayNetwork::DestroyDetailedView() { | 299 void TrayNetwork::DestroyDetailedView() { |
300 detailed_ = NULL; | 300 detailed_ = NULL; |
301 } | 301 } |
302 | 302 |
303 void TrayNetwork::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 303 void TrayNetwork::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
304 } | 304 } |
305 | 305 |
306 void TrayNetwork::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { | 306 void TrayNetwork::UpdateAfterShelfAlignmentChange( |
| 307 wm::ShelfAlignment alignment) { |
307 if (tray_) { | 308 if (tray_) { |
308 SetTrayImageItemBorder(tray_, alignment); | 309 SetTrayImageItemBorder(tray_, alignment); |
309 tray_->UpdateAlignment(alignment); | 310 tray_->UpdateAlignment(alignment); |
310 } | 311 } |
311 } | 312 } |
312 | 313 |
313 void TrayNetwork::RequestToggleWifi() { | 314 void TrayNetwork::RequestToggleWifi() { |
314 // This will always be triggered by a user action (e.g. keyboard shortcut) | 315 // This will always be triggered by a user action (e.g. keyboard shortcut) |
315 if (!detailed_ || | 316 if (!detailed_ || |
316 detailed_->GetViewType() == tray::NetworkDetailedView::WIFI_VIEW) { | 317 detailed_->GetViewType() == tray::NetworkDetailedView::WIFI_VIEW) { |
(...skipping 17 matching lines...) Expand all Loading... |
334 void TrayNetwork::NetworkStateChanged() { | 335 void TrayNetwork::NetworkStateChanged() { |
335 if (tray_) | 336 if (tray_) |
336 tray_->UpdateNetworkStateHandlerIcon(); | 337 tray_->UpdateNetworkStateHandlerIcon(); |
337 if (default_) | 338 if (default_) |
338 default_->Update(); | 339 default_->Update(); |
339 if (detailed_) | 340 if (detailed_) |
340 detailed_->Update(); | 341 detailed_->Update(); |
341 } | 342 } |
342 | 343 |
343 } // namespace ash | 344 } // namespace ash |
OLD | NEW |