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/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" | 11 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" |
11 #include "ash/system/chromeos/network/tray_network_state_observer.h" | 12 #include "ash/system/chromeos/network/tray_network_state_observer.h" |
12 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
13 #include "ash/system/tray/system_tray_delegate.h" | 14 #include "ash/system/tray/system_tray_delegate.h" |
14 #include "ash/system/tray/system_tray_notifier.h" | 15 #include "ash/system/tray/system_tray_notifier.h" |
15 #include "ash/system/tray/tray_constants.h" | 16 #include "ash/system/tray/tray_constants.h" |
16 #include "ash/system/tray/tray_item_more.h" | 17 #include "ash/system/tray/tray_item_more.h" |
17 #include "ash/system/tray/tray_item_view.h" | 18 #include "ash/system/tray/tray_item_view.h" |
18 #include "ash/system/tray/tray_utils.h" | 19 #include "ash/system/tray/tray_utils.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); | 85 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); |
85 if (connected_network) { | 86 if (connected_network) { |
86 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), | 87 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), |
87 true); | 88 true); |
88 } else { | 89 } else { |
89 UpdateConnectionStatus(base::string16(), false); | 90 UpdateConnectionStatus(base::string16(), false); |
90 } | 91 } |
91 } | 92 } |
92 | 93 |
93 void UpdateAlignment(ShelfAlignment alignment) { | 94 void UpdateAlignment(ShelfAlignment alignment) { |
94 SetLayoutManager(new views::BoxLayout(alignment == SHELF_ALIGNMENT_BOTTOM | 95 SetLayoutManager(new views::BoxLayout(IsHorizontalAlignment(alignment) |
95 ? views::BoxLayout::kHorizontal | 96 ? views::BoxLayout::kHorizontal |
96 : views::BoxLayout::kVertical, | 97 : views::BoxLayout::kVertical, |
97 0, 0, 0)); | 98 0, 0, 0)); |
98 Layout(); | 99 Layout(); |
99 } | 100 } |
100 | 101 |
101 // views::View override. | 102 // views::View override. |
102 void GetAccessibleState(ui::AXViewState* state) override { | 103 void GetAccessibleState(ui::AXViewState* state) override { |
103 state->name = connection_status_string_; | 104 state->name = connection_status_string_; |
104 state->role = ui::AX_ROLE_BUTTON; | 105 state->role = ui::AX_ROLE_BUTTON; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void TrayNetwork::NetworkStateChanged() { | 334 void TrayNetwork::NetworkStateChanged() { |
334 if (tray_) | 335 if (tray_) |
335 tray_->UpdateNetworkStateHandlerIcon(); | 336 tray_->UpdateNetworkStateHandlerIcon(); |
336 if (default_) | 337 if (default_) |
337 default_->Update(); | 338 default_->Update(); |
338 if (detailed_) | 339 if (detailed_) |
339 detailed_->Update(); | 340 detailed_->Update(); |
340 } | 341 } |
341 | 342 |
342 } // namespace ash | 343 } // namespace ash |
OLD | NEW |