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

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

Issue 2839043004: chromeos: Refactor ash SystemTrayDelegate enterprise methods to mojo (Closed)
Patch Set: review comments Created 3 years, 7 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 | « ash/system/tray/system_tray_delegate.cc ('k') | chrome/app/chromeos_strings.grdp » ('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/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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_view_ids.h" 11 #include "ash/ash_view_ids.h"
12 #include "ash/login_status.h" 12 #include "ash/login_status.h"
13 #include "ash/media_controller.h" 13 #include "ash/media_controller.h"
14 #include "ash/resources/vector_icons/vector_icons.h" 14 #include "ash/resources/vector_icons/vector_icons.h"
15 #include "ash/session/session_controller.h" 15 #include "ash/session/session_controller.h"
16 #include "ash/shell.h" 16 #include "ash/shell.h"
17 #include "ash/strings/grit/ash_strings.h" 17 #include "ash/strings/grit/ash_strings.h"
18 #include "ash/system/tray/system_tray_controller.h" 18 #include "ash/system/tray/system_tray_controller.h"
19 #include "ash/system/tray/system_tray_delegate.h"
20 #include "ash/system/tray/tray_constants.h" 19 #include "ash/system/tray/tray_constants.h"
21 #include "ash/system/tray/tray_popup_item_style.h" 20 #include "ash/system/tray/tray_popup_item_style.h"
22 #include "ash/system/user/rounded_image_view.h" 21 #include "ash/system/user/rounded_image_view.h"
23 #include "base/i18n/rtl.h" 22 #include "base/i18n/rtl.h"
24 #include "base/memory/ptr_util.h" 23 #include "base/memory/ptr_util.h"
25 #include "base/strings/string16.h" 24 #include "base/strings/string16.h"
26 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
27 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
28 #include "components/user_manager/user_info.h" 27 #include "components/user_manager/user_info.h"
29 #include "ui/accessibility/ax_node_data.h" 28 #include "ui/accessibility/ax_node_data.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 117
119 // Retrieve the user's display name and wrap it with markers. 118 // Retrieve the user's display name and wrap it with markers.
120 // Note that since this is a public account it always has to be the primary 119 // Note that since this is a public account it always has to be the primary
121 // user. 120 // user.
122 base::string16 display_name = base::UTF8ToUTF16( 121 base::string16 display_name = base::UTF8ToUTF16(
123 Shell::Get()->session_controller()->GetUserSession(0)->display_name); 122 Shell::Get()->session_controller()->GetUserSession(0)->display_name);
124 base::RemoveChars(display_name, kDisplayNameMark, &display_name); 123 base::RemoveChars(display_name, kDisplayNameMark, &display_name);
125 display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0]; 124 display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0];
126 // Retrieve the domain managing the device and wrap it with markers. 125 // Retrieve the domain managing the device and wrap it with markers.
127 base::string16 domain = base::UTF8ToUTF16( 126 base::string16 domain = base::UTF8ToUTF16(
128 Shell::Get()->system_tray_delegate()->GetEnterpriseDomain()); 127 Shell::Get()->system_tray_controller()->enterprise_domain());
129 base::RemoveChars(domain, kDisplayNameMark, &domain); 128 base::RemoveChars(domain, kDisplayNameMark, &domain);
130 base::i18n::WrapStringWithLTRFormatting(&domain); 129 base::i18n::WrapStringWithLTRFormatting(&domain);
131 // Retrieve the label text, inserting the display name and domain. 130 // Retrieve the label text, inserting the display name and domain.
132 text_ = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_PUBLIC_LABEL, 131 text_ = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_PUBLIC_LABEL,
133 display_name, domain); 132 display_name, domain);
134 133
135 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_ASH_LEARN_MORE)); 134 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_ASH_LEARN_MORE));
136 learn_more_->SetUnderline(false); 135 learn_more_->SetUnderline(false);
137 learn_more_->set_listener(this); 136 learn_more_->set_listener(this);
138 AddChildView(learn_more_); 137 AddChildView(learn_more_);
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 media_capture_container_ = new views::View(); 440 media_capture_container_ = new views::View();
442 media_capture_container_->SetLayoutManager(new views::FillLayout()); 441 media_capture_container_->SetLayoutManager(new views::FillLayout());
443 media_capture_container_->AddChildView(media_capture_icon_); 442 media_capture_container_->AddChildView(media_capture_icon_);
444 AddChildView(media_capture_container_); 443 AddChildView(media_capture_container_);
445 444
446 Shell::Get()->media_controller()->RequestCaptureState(); 445 Shell::Get()->media_controller()->RequestCaptureState();
447 } 446 }
448 447
449 } // namespace tray 448 } // namespace tray
450 } // namespace ash 449 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_delegate.cc ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698