Chromium Code Reviews| 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/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 39 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 40 #include "components/signin/core/browser/signin_error_controller.h" | 40 #include "components/signin/core/browser/signin_error_controller.h" |
| 41 #include "components/signin/core/browser/signin_header_helper.h" | 41 #include "components/signin/core/browser/signin_header_helper.h" |
| 42 #include "components/signin/core/browser/signin_manager.h" | 42 #include "components/signin/core/browser/signin_manager.h" |
| 43 #include "components/signin/core/common/profile_management_switches.h" | 43 #include "components/signin/core/common/profile_management_switches.h" |
| 44 #include "content/public/browser/render_widget_host_view.h" | 44 #include "content/public/browser/render_widget_host_view.h" |
| 45 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
| 46 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
| 47 #include "third_party/skia/include/core/SkColor.h" | 47 #include "third_party/skia/include/core/SkColor.h" |
| 48 #include "ui/base/l10n/l10n_util.h" | 48 #include "ui/base/l10n/l10n_util.h" |
| 49 #include "ui/base/material_design/material_design_controller.h" | |
| 49 #include "ui/base/resource/resource_bundle.h" | 50 #include "ui/base/resource/resource_bundle.h" |
| 50 #include "ui/compositor/clip_recorder.h" | 51 #include "ui/compositor/clip_recorder.h" |
| 51 #include "ui/gfx/canvas.h" | 52 #include "ui/gfx/canvas.h" |
| 52 #include "ui/gfx/color_palette.h" | 53 #include "ui/gfx/color_palette.h" |
| 53 #include "ui/gfx/image/canvas_image_source.h" | 54 #include "ui/gfx/image/canvas_image_source.h" |
| 54 #include "ui/gfx/image/image.h" | 55 #include "ui/gfx/image/image.h" |
| 55 #include "ui/gfx/image/image_skia.h" | 56 #include "ui/gfx/image/image_skia.h" |
| 56 #include "ui/gfx/paint_vector_icon.h" | 57 #include "ui/gfx/paint_vector_icon.h" |
| 57 #include "ui/gfx/path.h" | 58 #include "ui/gfx/path.h" |
| 58 #include "ui/gfx/skia_util.h" | 59 #include "ui/gfx/skia_util.h" |
| 59 #include "ui/gfx/text_elider.h" | 60 #include "ui/gfx/text_elider.h" |
| 60 #include "ui/gfx/vector_icons_public.h" | 61 #include "ui/gfx/vector_icons_public.h" |
| 61 #include "ui/native_theme/common_theme.h" | 62 #include "ui/native_theme/common_theme.h" |
| 62 #include "ui/native_theme/native_theme.h" | 63 #include "ui/native_theme/native_theme.h" |
| 63 #include "ui/views/controls/button/blue_button.h" | 64 #include "ui/views/controls/button/blue_button.h" |
| 64 #include "ui/views/controls/button/image_button.h" | 65 #include "ui/views/controls/button/image_button.h" |
| 65 #include "ui/views/controls/button/label_button.h" | 66 #include "ui/views/controls/button/label_button.h" |
| 66 #include "ui/views/controls/button/label_button_border.h" | 67 #include "ui/views/controls/button/label_button_border.h" |
| 68 #include "ui/views/controls/button/md_text_button.h" | |
| 67 #include "ui/views/controls/button/menu_button.h" | 69 #include "ui/views/controls/button/menu_button.h" |
| 68 #include "ui/views/controls/label.h" | 70 #include "ui/views/controls/label.h" |
| 69 #include "ui/views/controls/link.h" | 71 #include "ui/views/controls/link.h" |
| 70 #include "ui/views/controls/separator.h" | 72 #include "ui/views/controls/separator.h" |
| 71 #include "ui/views/controls/styled_label.h" | 73 #include "ui/views/controls/styled_label.h" |
| 72 #include "ui/views/controls/textfield/textfield.h" | 74 #include "ui/views/controls/textfield/textfield.h" |
| 73 #include "ui/views/controls/webview/webview.h" | 75 #include "ui/views/controls/webview/webview.h" |
| 74 #include "ui/views/layout/box_layout.h" | 76 #include "ui/views/layout/box_layout.h" |
| 75 #include "ui/views/layout/fill_layout.h" | 77 #include "ui/views/layout/fill_layout.h" |
| 76 #include "ui/views/layout/grid_layout.h" | 78 #include "ui/views/layout/grid_layout.h" |
| (...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 content_label->SetMultiLine(true); | 1280 content_label->SetMultiLine(true); |
| 1279 content_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 1281 content_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 1280 content_label->SetAutoColorReadabilityEnabled(false); | 1282 content_label->SetAutoColorReadabilityEnabled(false); |
| 1281 content_label->SetEnabledColor(profiles::kAvatarTutorialContentTextColor); | 1283 content_label->SetEnabledColor(profiles::kAvatarTutorialContentTextColor); |
| 1282 layout->StartRowWithPadding(1, 0, 0, views::kRelatedControlVerticalSpacing); | 1284 layout->StartRowWithPadding(1, 0, 0, views::kRelatedControlVerticalSpacing); |
| 1283 layout->AddView(content_label); | 1285 layout->AddView(content_label); |
| 1284 | 1286 |
| 1285 // Adds links and buttons. | 1287 // Adds links and buttons. |
| 1286 bool has_button = !button_text.empty(); | 1288 bool has_button = !button_text.empty(); |
| 1287 if (has_button) { | 1289 if (has_button) { |
| 1288 *button = new views::LabelButton(this, button_text); | 1290 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
|
msw
2016/05/12 19:17:04
q: why isn't this needed elsewhere?
Evan Stade
2016/05/12 19:32:02
because the factory in MdTextButton creates the ap
| |
| 1289 (*button)->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 1291 *button = views::MdTextButton::CreateMdButton(this, button_text); |
| 1290 (*button)->SetStyle(views::Button::STYLE_BUTTON); | 1292 (*button)->SetEnabledTextColors(SK_ColorWHITE); |
|
msw
2016/05/12 19:17:04
nit: use a theme color?
Evan Stade
2016/05/12 19:32:02
this isn't a surface that can be themed. This whit
| |
| 1293 } else { | |
| 1294 *button = new views::LabelButton(this, button_text); | |
| 1295 (*button)->SetStyle(views::Button::STYLE_BUTTON); | |
| 1296 (*button)->SetHorizontalAlignment(gfx::ALIGN_CENTER); | |
| 1297 } | |
| 1291 } | 1298 } |
| 1292 | 1299 |
| 1293 bool has_link = !link_text.empty(); | 1300 bool has_link = !link_text.empty(); |
| 1294 if (has_link) { | 1301 if (has_link) { |
| 1295 *link = CreateLink(link_text, this); | 1302 *link = CreateLink(link_text, this); |
| 1296 (*link)->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 1303 (*link)->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 1297 (*link)->SetAutoColorReadabilityEnabled(false); | 1304 (*link)->SetAutoColorReadabilityEnabled(false); |
| 1298 (*link)->SetEnabledColor(SK_ColorWHITE); | 1305 (*link)->SetEnabledColor(SK_ColorWHITE); |
| 1299 } | 1306 } |
| 1300 | 1307 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1880 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1887 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1881 IncognitoModePrefs::DISABLED; | 1888 IncognitoModePrefs::DISABLED; |
| 1882 return incognito_available && !browser_->profile()->IsGuestSession(); | 1889 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1883 } | 1890 } |
| 1884 | 1891 |
| 1885 void ProfileChooserView::PostActionPerformed( | 1892 void ProfileChooserView::PostActionPerformed( |
| 1886 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1893 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1887 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1894 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1888 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1895 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1889 } | 1896 } |
| OLD | NEW |