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

Side by Side Diff: ash/system/chromeos/tray_caps_lock.cc

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 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/tray_caps_lock.h ('k') | ash/system/chromeos/tray_display.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/tray_caps_lock.h" 5 #include "ash/system/chromeos/tray_caps_lock.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/tray/actionable_view.h" 9 #include "ash/system/tray/actionable_view.h"
10 #include "ash/system/tray/fixed_sized_image_view.h" 10 #include "ash/system/tray/fixed_sized_image_view.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } else if (detailed_) { 166 } else if (detailed_) {
167 detailed_->GetWidget()->Close(); 167 detailed_->GetWidget()->Close();
168 } 168 }
169 } 169 }
170 } 170 }
171 171
172 bool TrayCapsLock::GetInitialVisibility() { 172 bool TrayCapsLock::GetInitialVisibility() {
173 return CapsLockIsEnabled(); 173 return CapsLockIsEnabled();
174 } 174 }
175 175
176 views::View* TrayCapsLock::CreateDefaultView(user::LoginStatus status) { 176 views::View* TrayCapsLock::CreateDefaultView(LoginStatus status) {
177 if (!caps_lock_enabled_) 177 if (!caps_lock_enabled_)
178 return NULL; 178 return NULL;
179 DCHECK(default_ == NULL); 179 DCHECK(default_ == NULL);
180 default_ = new CapsLockDefaultView; 180 default_ = new CapsLockDefaultView;
181 default_->Update(caps_lock_enabled_); 181 default_->Update(caps_lock_enabled_);
182 return default_; 182 return default_;
183 } 183 }
184 184
185 views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) { 185 views::View* TrayCapsLock::CreateDetailedView(LoginStatus status) {
186 DCHECK(detailed_ == NULL); 186 DCHECK(detailed_ == NULL);
187 detailed_ = new views::View; 187 detailed_ = new views::View;
188 188
189 detailed_->SetLayoutManager(new 189 detailed_->SetLayoutManager(new
190 views::BoxLayout(views::BoxLayout::kHorizontal, 190 views::BoxLayout(views::BoxLayout::kHorizontal,
191 kTrayPopupPaddingHorizontal, 10, kTrayPopupPaddingBetweenItems)); 191 kTrayPopupPaddingHorizontal, 10, kTrayPopupPaddingBetweenItems));
192 192
193 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 193 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
194 views::ImageView* image = new views::ImageView; 194 views::ImageView* image = new views::ImageView;
195 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK). 195 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK).
(...skipping 17 matching lines...) Expand all
213 213
214 void TrayCapsLock::DestroyDefaultView() { 214 void TrayCapsLock::DestroyDefaultView() {
215 default_ = NULL; 215 default_ = NULL;
216 } 216 }
217 217
218 void TrayCapsLock::DestroyDetailedView() { 218 void TrayCapsLock::DestroyDetailedView() {
219 detailed_ = NULL; 219 detailed_ = NULL;
220 } 220 }
221 221
222 } // namespace ash 222 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/tray_caps_lock.h ('k') | ash/system/chromeos/tray_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698