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

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: Modified CL to provide TrayItems and Tray*Views with parent pointers instead. 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.h"
9 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ash/system/tray/tray_constants.h" 11 #include "ash/system/tray/tray_constants.h"
11 #include "ash/system/tray/tray_views.h" 12 #include "ash/system/tray/tray_views.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "grit/ash_resources.h" 15 #include "grit/ash_resources.h"
15 #include "grit/ash_strings.h" 16 #include "grit/ash_strings.h"
16 #include "third_party/skia/include/core/SkColor.h" 17 #include "third_party/skia/include/core/SkColor.h"
17 #include "ui/base/accessibility/accessible_view_state.h" 18 #include "ui/base/accessibility/accessible_view_state.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 private: 108 private:
108 user::LoginStatus login_status_; 109 user::LoginStatus login_status_;
109 views::Label* label_; 110 views::Label* label_;
110 ash::internal::PowerStatusView* power_status_view_; 111 ash::internal::PowerStatusView* power_status_view_;
111 112
112 DISALLOW_COPY_AND_ASSIGN(SettingsDefaultView); 113 DISALLOW_COPY_AND_ASSIGN(SettingsDefaultView);
113 }; 114 };
114 115
115 } // namespace tray 116 } // namespace tray
116 117
117 TraySettings::TraySettings() 118 TraySettings::TraySettings(SystemTray* system_tray)
118 : default_view_(NULL) { 119 : SystemTrayItem(system_tray),
120 default_view_(NULL) {
119 } 121 }
120 122
121 TraySettings::~TraySettings() {} 123 TraySettings::~TraySettings() {}
122 124
123 views::View* TraySettings::CreateTrayView(user::LoginStatus status) { 125 views::View* TraySettings::CreateTrayView(user::LoginStatus status) {
124 return NULL; 126 return NULL;
125 } 127 }
126 128
127 views::View* TraySettings::CreateDefaultView(user::LoginStatus status) { 129 views::View* TraySettings::CreateDefaultView(user::LoginStatus status) {
128 if ((status == user::LOGGED_IN_NONE || status == user::LOGGED_IN_LOCKED) && 130 if ((status == user::LOGGED_IN_NONE || status == user::LOGGED_IN_LOCKED) &&
(...skipping 25 matching lines...) Expand all
154 } 156 }
155 157
156 // Overridden from PowerStatusObserver. 158 // Overridden from PowerStatusObserver.
157 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) { 159 void TraySettings::OnPowerStatusChanged(const PowerSupplyStatus& status) {
158 if (default_view_) 160 if (default_view_)
159 default_view_->UpdatePowerStatus(status); 161 default_view_->UpdatePowerStatus(status);
160 } 162 }
161 163
162 } // namespace internal 164 } // namespace internal
163 } // namespace ash 165 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698