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

Side by Side Diff: ash/common/system/chromeos/screen_security/screen_tray_item.cc

Issue 2465403002: Some more fixes to cros system tray icons (esp. screen tray items) (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/common/system/chromeos/screen_security/screen_tray_item.h" 5 #include "ash/common/system/chromeos/screen_security/screen_tray_item.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/wm_shelf_util.h" 8 #include "ash/common/shelf/wm_shelf_util.h"
9 #include "ash/common/system/tray/fixed_sized_image_view.h" 9 #include "ash/common/system/tray/fixed_sized_image_view.h"
10 #include "ash/common/system/tray/tray_constants.h" 10 #include "ash/common/system/tray/tray_constants.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 Update(); 176 Update();
177 177
178 if (stop_callback_.is_null()) 178 if (stop_callback_.is_null())
179 return; 179 return;
180 180
181 base::Closure callback = stop_callback_; 181 base::Closure callback = stop_callback_;
182 stop_callback_.Reset(); 182 stop_callback_.Reset();
183 callback.Run(); 183 callback.Run();
184 } 184 }
185 185
186 views::View* ScreenTrayItem::CreateTrayView(LoginStatus status) {
tdanderson 2016/11/01 20:25:08 Nice catch.
187 tray_view_ = new tray::ScreenTrayView(this);
188 return tray_view_;
189 }
190
186 void ScreenTrayItem::RecordStoppedFromDefaultViewMetric() {} 191 void ScreenTrayItem::RecordStoppedFromDefaultViewMetric() {}
187 192
188 void ScreenTrayItem::RecordStoppedFromNotificationViewMetric() {} 193 void ScreenTrayItem::RecordStoppedFromNotificationViewMetric() {}
189 194
190 void ScreenTrayItem::DestroyTrayView() { 195 void ScreenTrayItem::DestroyTrayView() {
191 tray_view_ = NULL; 196 tray_view_ = NULL;
192 } 197 }
193 198
194 void ScreenTrayItem::DestroyDefaultView() { 199 void ScreenTrayItem::DestroyDefaultView() {
195 default_view_ = NULL; 200 default_view_ = NULL;
196 } 201 }
197 202
198 void ScreenTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
199 if (!tray_view_)
200 return;
201
202 // Center the item dependent on the orientation of the shelf.
203 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment)
204 ? views::BoxLayout::kHorizontal
205 : views::BoxLayout::kVertical;
206 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0));
207 tray_view_->Layout();
208 }
209
210 } // namespace ash 203 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698