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 "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 : nullptr); | 254 : nullptr); |
255 | 255 |
256 SkColor text_color = GetNativeTheme()->GetSystemColor( | 256 SkColor text_color = GetNativeTheme()->GetSystemColor( |
257 is_selected ? ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor | 257 is_selected ? ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor |
258 : ui::NativeTheme::kColorId_LabelEnabledColor); | 258 : ui::NativeTheme::kColorId_LabelEnabledColor); |
259 SetEnabledTextColors(text_color); | 259 SetEnabledTextColors(text_color); |
260 if (title_) | 260 if (title_) |
261 title_->SetEnabledColor(text_color); | 261 title_->SetEnabledColor(text_color); |
262 | 262 |
263 if (subtitle_) { | 263 if (subtitle_) { |
264 DCHECK(!subtitle_->enabled()); | 264 subtitle_->SetEnabledColor(GetNativeTheme()->GetSystemColor( |
265 subtitle_->SetDisabledColor(GetNativeTheme()->GetSystemColor( | |
266 is_selected | 265 is_selected |
267 ? ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor | 266 ? ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor |
268 : ui::NativeTheme::kColorId_LabelDisabledColor)); | 267 : ui::NativeTheme::kColorId_LabelDisabledColor)); |
Peter Kasting
2017/06/01 04:55:58
Is there a TODO here to use the typography provide
tapted
2017/06/01 11:22:18
Heh, yeah I'd considered this. But if the samples
| |
269 } | 268 } |
270 } | 269 } |
271 | 270 |
272 views::Label* title_; | 271 views::Label* title_; |
273 views::Label* subtitle_; | 272 views::Label* subtitle_; |
274 | 273 |
275 DISALLOW_COPY_AND_ASSIGN(BackgroundColorHoverButton); | 274 DISALLOW_COPY_AND_ASSIGN(BackgroundColorHoverButton); |
276 }; | 275 }; |
277 | 276 |
278 // A view to host the GAIA webview overlapped with a back button. This class | 277 // A view to host the GAIA webview overlapped with a back button. This class |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1164 new BackgroundColorHoverButton(this, button_text); | 1163 new BackgroundColorHoverButton(this, button_text); |
1165 manage_accounts_button_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 1164 manage_accounts_button_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
1166 manage_accounts_button_->SetMinSize( | 1165 manage_accounts_button_->SetMinSize( |
1167 gfx::Size(kFixedMenuWidth, kButtonHeight)); | 1166 gfx::Size(kFixedMenuWidth, kButtonHeight)); |
1168 view->AddChildView(manage_accounts_button_); | 1167 view->AddChildView(manage_accounts_button_); |
1169 } else { | 1168 } else { |
1170 views::Label* email_label = new views::Label(avatar_item.username); | 1169 views::Label* email_label = new views::Label(avatar_item.username); |
1171 current_profile_card->set_subtitle(email_label); | 1170 current_profile_card->set_subtitle(email_label); |
1172 email_label->SetAutoColorReadabilityEnabled(false); | 1171 email_label->SetAutoColorReadabilityEnabled(false); |
1173 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); | 1172 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); |
1174 email_label->SetEnabled(false); | |
1175 email_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 1173 email_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
1176 grid_layout->StartRow(1, 0); | 1174 grid_layout->StartRow(1, 0); |
1177 // Skip first column for the profile icon. | 1175 // Skip first column for the profile icon. |
1178 grid_layout->SkipColumns(1); | 1176 grid_layout->SkipColumns(1); |
1179 grid_layout->AddView(email_label, 1, 1, views::GridLayout::LEADING, | 1177 grid_layout->AddView(email_label, 1, 1, views::GridLayout::LEADING, |
1180 views::GridLayout::LEADING); | 1178 views::GridLayout::LEADING); |
1181 } | 1179 } |
1182 | 1180 |
1183 current_profile_card_->SetAccessibleName( | 1181 current_profile_card_->SetAccessibleName( |
1184 l10n_util::GetStringFUTF16( | 1182 l10n_util::GetStringFUTF16( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1625 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1623 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1626 IncognitoModePrefs::DISABLED; | 1624 IncognitoModePrefs::DISABLED; |
1627 return incognito_available && !browser_->profile()->IsGuestSession(); | 1625 return incognito_available && !browser_->profile()->IsGuestSession(); |
1628 } | 1626 } |
1629 | 1627 |
1630 void ProfileChooserView::PostActionPerformed( | 1628 void ProfileChooserView::PostActionPerformed( |
1631 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1629 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1632 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1630 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1633 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1631 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1634 } | 1632 } |
OLD | NEW |