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

Side by Side Diff: ash/common/system/cast/tray_cast.cc

Issue 2223263003: Fix horizontal and vertical padding for Cast icon in Ash system tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/cast/tray_cast.h" 5 #include "ash/common/system/cast/tray_cast.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/shelf/shelf_types.h" 8 #include "ash/common/shelf/shelf_types.h"
9 #include "ash/common/shelf/wm_shelf_util.h" 9 #include "ash/common/shelf/wm_shelf_util.h"
10 #include "ash/common/system/chromeos/screen_security/screen_tray_item.h" 10 #include "ash/common/system/chromeos/screen_security/screen_tray_item.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() 346 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance()
347 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE) 347 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE)
348 .ToImageSkia()); 348 .ToImageSkia());
349 } 349 }
350 350
351 CastTrayView::~CastTrayView() {} 351 CastTrayView::~CastTrayView() {}
352 352
353 void CastTrayView::UpdateAlignment(ShelfAlignment alignment) { 353 void CastTrayView::UpdateAlignment(ShelfAlignment alignment) {
354 // Center the item dependent on the orientation of the shelf. 354 // Center the item dependent on the orientation of the shelf.
355 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) 355 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment)
356 ? views::BoxLayout::kVertical 356 ? views::BoxLayout::kHorizontal
357 : views::BoxLayout::kHorizontal; 357 : views::BoxLayout::kVertical;
358 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); 358 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0));
359 Layout(); 359 Layout();
360 } 360 }
361 361
362 // This view displays a list of cast receivers that can be clicked on and casted 362 // This view displays a list of cast receivers that can be clicked on and casted
363 // to. It is activated by clicking on the chevron inside of 363 // to. It is activated by clicking on the chevron inside of
364 // |CastSelectDefaultView|. 364 // |CastSelectDefaultView|.
365 class CastDetailedView : public TrayDetailsView, public ViewClickListener { 365 class CastDetailedView : public TrayDetailsView, public ViewClickListener {
366 public: 366 public:
367 CastDetailedView(SystemTrayItem* owner, 367 CastDetailedView(SystemTrayItem* owner,
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 is_casting_ = started; 662 is_casting_ = started;
663 UpdatePrimaryView(); 663 UpdatePrimaryView();
664 } 664 }
665 665
666 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 666 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
667 if (tray_) 667 if (tray_)
668 tray_->UpdateAlignment(alignment); 668 tray_->UpdateAlignment(alignment);
669 } 669 }
670 670
671 } // namespace ash 671 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698