OLD | NEW |
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/system/user/user_card_view.h" | 5 #include "ash/system/user/user_card_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); | 73 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); |
74 set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); | 74 set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); |
75 } | 75 } |
76 | 76 |
77 virtual ~MediaIndicator() { | 77 virtual ~MediaIndicator() { |
78 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( | 78 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( |
79 this); | 79 this); |
80 } | 80 } |
81 | 81 |
82 // MediaCaptureObserver: | 82 // MediaCaptureObserver: |
83 virtual void OnMediaCaptureChanged() OVERRIDE { | 83 virtual void OnMediaCaptureChanged() override { |
84 Shell* shell = Shell::GetInstance(); | 84 Shell* shell = Shell::GetInstance(); |
85 content::BrowserContext* context = | 85 content::BrowserContext* context = |
86 shell->session_state_delegate()->GetBrowserContextByIndex(index_); | 86 shell->session_state_delegate()->GetBrowserContextByIndex(index_); |
87 MediaCaptureState state = | 87 MediaCaptureState state = |
88 Shell::GetInstance()->media_delegate()->GetMediaCaptureState(context); | 88 Shell::GetInstance()->media_delegate()->GetMediaCaptureState(context); |
89 int res_id = 0; | 89 int res_id = 0; |
90 switch (state) { | 90 switch (state) { |
91 case MEDIA_CAPTURE_AUDIO_VIDEO: | 91 case MEDIA_CAPTURE_AUDIO_VIDEO: |
92 res_id = IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO_VIDEO; | 92 res_id = IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO_VIDEO; |
93 break; | 93 break; |
(...skipping 29 matching lines...) Expand all Loading... |
123 // but with custom painting code as the text is styled with multiple colors and | 123 // but with custom painting code as the text is styled with multiple colors and |
124 // contains a link. | 124 // contains a link. |
125 class PublicAccountUserDetails : public views::View, | 125 class PublicAccountUserDetails : public views::View, |
126 public views::LinkListener { | 126 public views::LinkListener { |
127 public: | 127 public: |
128 PublicAccountUserDetails(int max_width); | 128 PublicAccountUserDetails(int max_width); |
129 virtual ~PublicAccountUserDetails(); | 129 virtual ~PublicAccountUserDetails(); |
130 | 130 |
131 private: | 131 private: |
132 // Overridden from views::View. | 132 // Overridden from views::View. |
133 virtual void Layout() OVERRIDE; | 133 virtual void Layout() override; |
134 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 134 virtual gfx::Size GetPreferredSize() const override; |
135 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 135 virtual void OnPaint(gfx::Canvas* canvas) override; |
136 | 136 |
137 // Overridden from views::LinkListener. | 137 // Overridden from views::LinkListener. |
138 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 138 virtual void LinkClicked(views::Link* source, int event_flags) override; |
139 | 139 |
140 // Calculate a preferred size that ensures the label text and the following | 140 // Calculate a preferred size that ensures the label text and the following |
141 // link do not wrap over more than three lines in total for aesthetic reasons | 141 // link do not wrap over more than three lines in total for aesthetic reasons |
142 // if possible. | 142 // if possible. |
143 void CalculatePreferredSize(int max_allowed_width); | 143 void CalculatePreferredSize(int max_allowed_width); |
144 | 144 |
145 base::string16 text_; | 145 base::string16 text_; |
146 views::Link* learn_more_; | 146 views::Link* learn_more_; |
147 gfx::Size preferred_size_; | 147 gfx::Size preferred_size_; |
148 ScopedVector<gfx::RenderText> lines_; | 148 ScopedVector<gfx::RenderText> lines_; |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 content::BrowserContext* context = | 469 content::BrowserContext* context = |
470 delegate->GetBrowserContextByIndex(multiprofile_index); | 470 delegate->GetBrowserContextByIndex(multiprofile_index); |
471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), | 471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), |
472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); | 472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); |
473 } | 473 } |
474 return icon; | 474 return icon; |
475 } | 475 } |
476 | 476 |
477 } // namespace tray | 477 } // namespace tray |
478 } // namespace ash | 478 } // namespace ash |
OLD | NEW |