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

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

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tray_user.h" 5 #include "ash/system/user/tray_user.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <climits> 8 #include <climits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 const bool rtl = base::i18n::IsRTL(); 474 const bool rtl = base::i18n::IsRTL();
475 set_border(views::Border::CreateEmptyBorder( 475 set_border(views::Border::CreateEmptyBorder(
476 kUserDetailsVerticalPadding, rtl ? 0 : inner_padding, 476 kUserDetailsVerticalPadding, rtl ? 0 : inner_padding,
477 kUserDetailsVerticalPadding, rtl ? inner_padding : 0)); 477 kUserDetailsVerticalPadding, rtl ? inner_padding : 0));
478 478
479 // Retrieve the user's display name and wrap it with markers. 479 // Retrieve the user's display name and wrap it with markers.
480 // Note that since this is a public account it always has to be the primary 480 // Note that since this is a public account it always has to be the primary
481 // user. 481 // user.
482 base::string16 display_name = 482 base::string16 display_name =
483 Shell::GetInstance()->session_state_delegate()->GetUserDisplayName(0); 483 Shell::GetInstance()->session_state_delegate()->GetUserDisplayName(0);
484 RemoveChars(display_name, kDisplayNameMark, &display_name); 484 base::RemoveChars(display_name, kDisplayNameMark, &display_name);
485 display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0]; 485 display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0];
486 // Retrieve the domain managing the device and wrap it with markers. 486 // Retrieve the domain managing the device and wrap it with markers.
487 base::string16 domain = UTF8ToUTF16( 487 base::string16 domain = UTF8ToUTF16(
488 Shell::GetInstance()->system_tray_delegate()->GetEnterpriseDomain()); 488 Shell::GetInstance()->system_tray_delegate()->GetEnterpriseDomain());
489 RemoveChars(domain, kDisplayNameMark, &domain); 489 base::RemoveChars(domain, kDisplayNameMark, &domain);
490 base::i18n::WrapStringWithLTRFormatting(&domain); 490 base::i18n::WrapStringWithLTRFormatting(&domain);
491 // Retrieve the label text, inserting the display name and domain. 491 // Retrieve the label text, inserting the display name and domain.
492 text_ = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_PUBLIC_LABEL, 492 text_ = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_PUBLIC_LABEL,
493 display_name, domain); 493 display_name, domain);
494 494
495 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_ASH_LEARN_MORE)); 495 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_ASH_LEARN_MORE));
496 learn_more_->SetUnderline(false); 496 learn_more_->SetUnderline(false);
497 learn_more_->set_listener(this); 497 learn_more_->set_listener(this);
498 AddChildView(learn_more_); 498 AddChildView(learn_more_);
499 499
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 internal::GetRootWindowController( 1413 internal::GetRootWindowController(
1414 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); 1414 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow());
1415 if (controller && controller->shelf()) { 1415 if (controller && controller->shelf()) {
1416 UpdateAfterShelfAlignmentChange( 1416 UpdateAfterShelfAlignmentChange(
1417 controller->GetShelfLayoutManager()->GetAlignment()); 1417 controller->GetShelfLayoutManager()->GetAlignment());
1418 } 1418 }
1419 } 1419 }
1420 1420
1421 } // namespace internal 1421 } // namespace internal
1422 } // namespace ash 1422 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698