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

Side by Side Diff: ash/system/settings/tray_settings.cc

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/settings/tray_settings.h" 5 #include "ash/system/settings/tray_settings.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/power/power_status_view.h" 8 #include "ash/system/power/power_status_view.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 TraySettings::TraySettings() 117 TraySettings::TraySettings()
118 : default_view_(NULL) { 118 : default_view_(NULL) {
119 } 119 }
120 120
121 TraySettings::~TraySettings() {} 121 TraySettings::~TraySettings() {}
122 122
123 views::View* TraySettings::CreateTrayView(user::LoginStatus status) { 123 views::View* TraySettings::CreateTrayView(user::LoginStatus status) {
124 return NULL; 124 return NULL;
125 } 125 }
126 126
127 views::View* TraySettings::CreateDefaultView(user::LoginStatus status) { 127 views::View* TraySettings::CreateDefaultView(user::LoginStatus status,
128 int bubble_width) {
128 if ((status == user::LOGGED_IN_NONE || status == user::LOGGED_IN_LOCKED) && 129 if ((status == user::LOGGED_IN_NONE || status == user::LOGGED_IN_LOCKED) &&
129 (!ash::Shell::GetInstance()->tray_delegate()-> 130 (!ash::Shell::GetInstance()->tray_delegate()->
130 GetPowerSupplyStatus().battery_is_present)) 131 GetPowerSupplyStatus().battery_is_present))
131 return NULL; 132 return NULL;
132 133
133 CHECK(default_view_ == NULL); 134 CHECK(default_view_ == NULL);
134 default_view_ = new tray::SettingsDefaultView(status); 135 default_view_ = new tray::SettingsDefaultView(status);
135 return default_view_; 136 return default_view_;
136 } 137 }
137 138
(...skipping 16 matching lines...) Expand all
154 } 155 }
155 156
156 // Overridden from PowerStatusObserver. 157 // Overridden from PowerStatusObserver.
157 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) { 158 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) {
158 if (default_view_) 159 if (default_view_)
159 default_view_->UpdatePowerStatus(status); 160 default_view_->UpdatePowerStatus(status);
160 } 161 }
161 162
162 } // namespace internal 163 } // namespace internal
163 } // namespace ash 164 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698