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

Side by Side Diff: ash/common/system/chromeos/media_security/multi_profile_media_tray_item.cc

Issue 2758453002: Remove pre-MD code from TrayItemView. (Closed)
Patch Set: bonus round Created 3 years, 9 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 | ash/common/system/tray/tray_item_view.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/media_security/multi_profile_media_tray_ite m.h" 5 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite m.h"
6 6
7 #include "ash/common/ash_view_ids.h" 7 #include "ash/common/ash_view_ids.h"
8 #include "ash/common/media_controller.h" 8 #include "ash/common/media_controller.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/system/tray/tray_constants.h" 11 #include "ash/common/system/tray/tray_constants.h"
12 #include "ash/common/system/tray/tray_item_view.h" 12 #include "ash/common/system/tray/tray_item_view.h"
13 #include "ash/common/wm_shell.h" 13 #include "ash/common/wm_shell.h"
14 #include "ash/resources/grit/ash_resources.h"
15 #include "ash/resources/vector_icons/vector_icons.h" 14 #include "ash/resources/vector_icons/vector_icons.h"
16 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/gfx/paint_vector_icon.h" 15 #include "ui/gfx/paint_vector_icon.h"
18 #include "ui/views/controls/image_view.h" 16 #include "ui/views/controls/image_view.h"
19 17
20 namespace ash { 18 namespace ash {
21 namespace tray { 19 namespace tray {
22 20
23 class MultiProfileMediaTrayView : public TrayItemView, 21 class MultiProfileMediaTrayView : public TrayItemView,
24 public MediaCaptureObserver { 22 public MediaCaptureObserver {
25 public: 23 public:
26 explicit MultiProfileMediaTrayView(SystemTrayItem* system_tray_item) 24 explicit MultiProfileMediaTrayView(SystemTrayItem* system_tray_item)
27 : TrayItemView(system_tray_item) { 25 : TrayItemView(system_tray_item) {
28 CreateImageView(); 26 CreateImageView();
29 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
30 image_view()->SetImage( 27 image_view()->SetImage(
31 UseMd() 28 gfx::CreateVectorIcon(kSystemTrayRecordingIcon, kTrayIconColor));
32 ? gfx::CreateVectorIcon(kSystemTrayRecordingIcon, kTrayIconColor)
33 : *bundle.GetImageSkiaNamed(IDR_AURA_UBER_TRAY_RECORDING));
34 WmShell::Get()->media_controller()->AddObserver(this); 29 WmShell::Get()->media_controller()->AddObserver(this);
35 SetVisible(false); 30 SetVisible(false);
36 WmShell::Get()->media_controller()->RequestCaptureState(); 31 WmShell::Get()->media_controller()->RequestCaptureState();
37 set_id(VIEW_ID_MEDIA_TRAY_VIEW); 32 set_id(VIEW_ID_MEDIA_TRAY_VIEW);
38 } 33 }
39 34
40 ~MultiProfileMediaTrayView() override { 35 ~MultiProfileMediaTrayView() override {
41 WmShell::Get()->media_controller()->RemoveObserver(this); 36 WmShell::Get()->media_controller()->RemoveObserver(this);
42 } 37 }
43 38
(...skipping 22 matching lines...) Expand all
66 MultiProfileMediaTrayItem::MultiProfileMediaTrayItem(SystemTray* system_tray) 61 MultiProfileMediaTrayItem::MultiProfileMediaTrayItem(SystemTray* system_tray)
67 : SystemTrayItem(system_tray, UMA_MULTI_PROFILE_MEDIA) {} 62 : SystemTrayItem(system_tray, UMA_MULTI_PROFILE_MEDIA) {}
68 63
69 MultiProfileMediaTrayItem::~MultiProfileMediaTrayItem() {} 64 MultiProfileMediaTrayItem::~MultiProfileMediaTrayItem() {}
70 65
71 views::View* MultiProfileMediaTrayItem::CreateTrayView(LoginStatus status) { 66 views::View* MultiProfileMediaTrayItem::CreateTrayView(LoginStatus status) {
72 return new tray::MultiProfileMediaTrayView(this); 67 return new tray::MultiProfileMediaTrayView(this);
73 } 68 }
74 69
75 } // namespace ash 70 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/tray_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698