Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: ash/system/chromeos/network/tray_network.cc

Issue 1914093002: Refactors DockedWindowLayoutManager in terms of ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nuke_aura_window
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/chromeos/network/tray_network.h ('k') | ash/system/chromeos/network/tray_vpn.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/tray_network.h ('k') | ash/system/chromeos/network/tray_vpn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698