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

Side by Side Diff: ash/system/tray_caps_lock.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/tray_caps_lock.h" 5 #include "ash/system/tray_caps_lock.h"
6 6
7 #include "ash/caps_lock_delegate.h" 7 #include "ash/caps_lock_delegate.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "ash/system/tray/tray_views.h" 10 #include "ash/system/tray/tray_views.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled()), 111 Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled()),
112 message_shown_(false) { 112 message_shown_(false) {
113 } 113 }
114 114
115 TrayCapsLock::~TrayCapsLock() {} 115 TrayCapsLock::~TrayCapsLock() {}
116 116
117 bool TrayCapsLock::GetInitialVisibility() { 117 bool TrayCapsLock::GetInitialVisibility() {
118 return Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled(); 118 return Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled();
119 } 119 }
120 120
121 views::View* TrayCapsLock::CreateDefaultView(user::LoginStatus status) { 121 views::View* TrayCapsLock::CreateDefaultView(user::LoginStatus status,
122 int bubble_width) {
122 if (!caps_lock_enabled_) 123 if (!caps_lock_enabled_)
123 return NULL; 124 return NULL;
124 DCHECK(default_ == NULL); 125 DCHECK(default_ == NULL);
125 default_ = new CapsLockDefaultView; 126 default_ = new CapsLockDefaultView;
126 default_->Update(caps_lock_enabled_, search_mapped_to_caps_lock_); 127 default_->Update(caps_lock_enabled_, search_mapped_to_caps_lock_);
127 return default_; 128 return default_;
128 } 129 }
129 130
130 views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) { 131 views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) {
131 DCHECK(detailed_ == NULL); 132 DCHECK(detailed_ == NULL);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 message_shown_ = true; 179 message_shown_ = true;
179 } 180 }
180 } else if (detailed_) { 181 } else if (detailed_) {
181 detailed_->GetWidget()->Close(); 182 detailed_->GetWidget()->Close();
182 } 183 }
183 } 184 }
184 } 185 }
185 186
186 } // namespace internal 187 } // namespace internal
187 } // namespace ash 188 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698