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

Side by Side Diff: ash/system/tray_update.cc

Issue 11476033: [Launcher per display] Removed Shell::status_area_widget(), system_tray() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style Created 8 years 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 | Annotate | Revision Log
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/tray_update.h" 5 #include "ash/system/tray_update.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/status_area_widget.h" 9 #include "ash/system/status_area_widget.h"
10 #include "ash/system/tray/system_tray.h" 10 #include "ash/system/tray/system_tray.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 public: 101 public:
102 explicit UpdateNagger(SystemTrayItem* owner) 102 explicit UpdateNagger(SystemTrayItem* owner)
103 : owner_(owner) { 103 : owner_(owner) {
104 RestartTimer(); 104 RestartTimer();
105 owner_->system_tray()->GetWidget()->GetNativeView()->layer()-> 105 owner_->system_tray()->GetWidget()->GetNativeView()->layer()->
106 GetAnimator()->AddObserver(this); 106 GetAnimator()->AddObserver(this);
107 } 107 }
108 108
109 virtual ~UpdateNagger() { 109 virtual ~UpdateNagger() {
110 internal::StatusAreaWidget* status_area = 110 internal::StatusAreaWidget* status_area =
111 ash::Shell::GetInstance()->status_area_widget(); 111 Shell::GetPrimaryRootWindowController()->status_area_widget();
112 if (status_area) { 112 if (status_area) {
113 status_area->system_tray()->GetWidget()->GetNativeView()->layer()-> 113 status_area->system_tray()->GetWidget()->GetNativeView()->layer()->
114 GetAnimator()->RemoveObserver(this); 114 GetAnimator()->RemoveObserver(this);
115 } 115 }
116 } 116 }
117 117
118 void RestartTimer() { 118 void RestartTimer() {
119 timer_.Stop(); 119 timer_.Stop();
120 timer_.Start(FROM_HERE, 120 timer_.Start(FROM_HERE,
121 base::TimeDelta::FromSeconds(kUpdateNaggingTimeSeconds), 121 base::TimeDelta::FromSeconds(kUpdateNaggingTimeSeconds),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 tray_view()->SetVisible(true); 190 tray_view()->SetVisible(true);
191 if (!Shell::GetPrimaryRootWindowController()->shelf()->IsVisible() && 191 if (!Shell::GetPrimaryRootWindowController()->shelf()->IsVisible() &&
192 !nagger_.get()) { 192 !nagger_.get()) {
193 // The shelf is not visible, and there is no nagger scheduled. 193 // The shelf is not visible, and there is no nagger scheduled.
194 nagger_.reset(new tray::UpdateNagger(this)); 194 nagger_.reset(new tray::UpdateNagger(this));
195 } 195 }
196 } 196 }
197 197
198 } // namespace internal 198 } // namespace internal
199 } // namespace ash 199 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/network_state_list_detailed_view.cc ('k') | ash/wm/gestures/tray_gesture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698