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

Side by Side Diff: ash/common/system/user/user_card_view.cc

Issue 2395523002: chromeos: Refactor system tray "show settings" commands to use mojo (Closed)
Patch Set: Created 4 years, 2 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 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/user/user_card_view.h" 5 #include "ash/common/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/common/login_status.h" 10 #include "ash/common/login_status.h"
11 #include "ash/common/session/session_state_delegate.h" 11 #include "ash/common/session/session_state_delegate.h"
12 #include "ash/common/system/tray/system_tray_controller.h"
12 #include "ash/common/system/tray/system_tray_delegate.h" 13 #include "ash/common/system/tray/system_tray_delegate.h"
13 #include "ash/common/system/tray/system_tray_notifier.h" 14 #include "ash/common/system/tray/system_tray_notifier.h"
14 #include "ash/common/system/tray/tray_constants.h" 15 #include "ash/common/system/tray/tray_constants.h"
15 #include "ash/common/system/tray/tray_utils.h" 16 #include "ash/common/system/tray/tray_utils.h"
16 #include "ash/common/system/user/rounded_image_view.h" 17 #include "ash/common/system/user/rounded_image_view.h"
17 #include "ash/common/wm_shell.h" 18 #include "ash/common/wm_shell.h"
18 #include "base/i18n/rtl.h" 19 #include "base/i18n/rtl.h"
19 #include "base/memory/scoped_vector.h" 20 #include "base/memory/scoped_vector.h"
20 #include "base/strings/string16.h" 21 #include "base/strings/string16.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 for (ScopedVector<gfx::RenderText>::const_iterator it = lines_.begin(); 262 for (ScopedVector<gfx::RenderText>::const_iterator it = lines_.begin();
262 it != lines_.end(); ++it) { 263 it != lines_.end(); ++it) {
263 (*it)->Draw(canvas); 264 (*it)->Draw(canvas);
264 } 265 }
265 views::View::OnPaint(canvas); 266 views::View::OnPaint(canvas);
266 } 267 }
267 268
268 void PublicAccountUserDetails::LinkClicked(views::Link* source, 269 void PublicAccountUserDetails::LinkClicked(views::Link* source,
269 int event_flags) { 270 int event_flags) {
270 DCHECK_EQ(source, learn_more_); 271 DCHECK_EQ(source, learn_more_);
271 WmShell::Get()->system_tray_delegate()->ShowPublicAccountInfo(); 272 WmShell::Get()->system_tray_controller()->ShowPublicAccountInfo();
272 } 273 }
273 274
274 void PublicAccountUserDetails::CalculatePreferredSize(int max_allowed_width) { 275 void PublicAccountUserDetails::CalculatePreferredSize(int max_allowed_width) {
275 const gfx::FontList font_list; 276 const gfx::FontList font_list;
276 const gfx::Size link_size = learn_more_->GetPreferredSize(); 277 const gfx::Size link_size = learn_more_->GetPreferredSize();
277 const int space_width = 278 const int space_width =
278 gfx::GetStringWidth(base::ASCIIToUTF16(" "), font_list); 279 gfx::GetStringWidth(base::ASCIIToUTF16(" "), font_list);
279 const gfx::Insets insets = GetInsets(); 280 const gfx::Insets insets = GetInsets();
280 int min_width = link_size.width(); 281 int min_width = link_size.width();
281 int max_width = std::min( 282 int max_width = std::min(
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } else { 442 } else {
442 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); 443 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate();
443 icon->SetImage(delegate->GetUserInfo(user_index)->GetImage(), 444 icon->SetImage(delegate->GetUserInfo(user_index)->GetImage(),
444 gfx::Size(kTrayItemSize, kTrayItemSize)); 445 gfx::Size(kTrayItemSize, kTrayItemSize));
445 } 446 }
446 return icon; 447 return icon;
447 } 448 }
448 449
449 } // namespace tray 450 } // namespace tray
450 } // namespace ash 451 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698