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

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

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback 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
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/system/cast/tray_cast.h" 5 #include "ash/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/tray/fixed_sized_image_view.h" 10 #include "ash/common/system/tray/fixed_sized_image_view.h"
(...skipping 27 matching lines...) Expand all
38 38
39 namespace ash { 39 namespace ash {
40 40
41 namespace { 41 namespace {
42 42
43 const size_t kMaximumStatusStringLength = 100; 43 const size_t kMaximumStatusStringLength = 100;
44 const int kStopButtonRightPadding = 18; 44 const int kStopButtonRightPadding = 18;
45 45
46 // Returns the active CastConfigDelegate instance. 46 // Returns the active CastConfigDelegate instance.
47 ash::CastConfigDelegate* GetCastConfigDelegate() { 47 ash::CastConfigDelegate* GetCastConfigDelegate() {
48 return ash::Shell::GetInstance() 48 return WmShell::Get()->system_tray_delegate()->GetCastConfigDelegate();
49 ->system_tray_delegate()
50 ->GetCastConfigDelegate();
51 } 49 }
52 50
53 // Helper method to elide the given string to the maximum length. If a string is 51 // Helper method to elide the given string to the maximum length. If a string is
54 // contains user-input and is displayed, we should elide it. 52 // contains user-input and is displayed, we should elide it.
55 // TODO(jdufault): This does not properly trim unicode characters. We should 53 // TODO(jdufault): This does not properly trim unicode characters. We should
56 // implement this properly by using views::Label::SetElideBehavior(...). See 54 // implement this properly by using views::Label::SetElideBehavior(...). See
57 // crbug.com/532496. 55 // crbug.com/532496.
58 base::string16 ElideString(const base::string16& text) { 56 base::string16 ElideString(const base::string16& text) {
59 base::string16 elided; 57 base::string16 elided;
60 gfx::ElideString(text, kMaximumStatusStringLength, &elided); 58 gfx::ElideString(text, kMaximumStatusStringLength, &elided);
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 is_casting_ = started; 672 is_casting_ = started;
675 UpdatePrimaryView(); 673 UpdatePrimaryView();
676 } 674 }
677 675
678 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 676 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
679 if (tray_) 677 if (tray_)
680 tray_->UpdateAlignment(alignment); 678 tray_->UpdateAlignment(alignment);
681 } 679 }
682 680
683 } // namespace ash 681 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698