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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 225963004: Adds a settings link to account removal UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index de901e4f6af77462b896a9a7f9602c0ba8cdc70b..bb3df649cb003fa3cd9d726699142b31d32eed4d 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/views/profiles/user_manager_view.h"
#include "chrome/common/pref_names.h"
@@ -43,6 +44,7 @@
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
#include "ui/views/controls/separator.h"
+#include "ui/views/controls/styled_label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/grid_layout.h"
@@ -642,6 +644,11 @@ void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) {
}
}
+void ProfileChooserView::StyledLabelLinkClicked(
+ const gfx::Range& range, int event_flags) {
+ chrome::ShowSettings(browser_);
+}
+
bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender,
const ui::KeyEvent& key_event) {
views::Textfield* name_textfield =
@@ -1083,19 +1090,33 @@ views::View* ProfileChooserView::CreateAccountRemovalView() {
bool is_primary_account = primary_account == account_id_to_remove_;
// Adds main text.
- views::Label* content_label = new views::Label(is_primary_account ?
- l10n_util::GetStringFUTF16(IDS_PROFILES_PRIMARY_ACCOUNT_REMOVAL_TEXT,
- base::UTF8ToUTF16(account_id_to_remove_)) :
- l10n_util::GetStringUTF16(IDS_PROFILES_ACCOUNT_REMOVAL_TEXT));
-
- content_label->SetMultiLine(true);
- content_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ layout->StartRowWithPadding(1, 0, 0, views::kUnrelatedControlVerticalSpacing);
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
const gfx::FontList& small_font_list =
rb->GetFontList(ui::ResourceBundle::SmallFont);
- content_label->SetFontList(small_font_list);
- layout->StartRowWithPadding(1, 0, 0, views::kUnrelatedControlVerticalSpacing);
- layout->AddView(content_label);
+
+ if (is_primary_account) {
+ std::vector<size_t> offsets;
+ const base::string16 settings_text =
+ l10n_util::GetStringUTF16(IDS_PROFILES_SETTINGS_LINK);
+ const base::string16 primmary_account_removal_text =
+ l10n_util::GetStringFUTF16(IDS_PROFILES_PRIMARY_ACCOUNT_REMOVAL_TEXT,
+ base::UTF8ToUTF16(account_id_to_remove_), settings_text, &offsets);
+ views::StyledLabel* primary_account_removal_label =
+ new views::StyledLabel(primmary_account_removal_text, this);
+ primary_account_removal_label->AddStyleRange(
+ gfx::Range(offsets[1], offsets[1] + settings_text.size()),
+ views::StyledLabel::RangeStyleInfo::CreateForLink());
+ primary_account_removal_label->SetBaseFontList(small_font_list);
+ layout->AddView(primary_account_removal_label);
+ } else {
+ views::Label* content_label = new views::Label(
+ l10n_util::GetStringUTF16(IDS_PROFILES_ACCOUNT_REMOVAL_TEXT));
+ content_label->SetMultiLine(true);
+ content_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ content_label->SetFontList(small_font_list);
+ layout->AddView(content_label);
+ }
// Adds button.
if (!is_primary_account) {
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698