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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "chrome/grit/theme_resources.h" | 45 #include "chrome/grit/theme_resources.h" |
46 #include "components/browser_sync/profile_sync_service.h" | 46 #include "components/browser_sync/profile_sync_service.h" |
47 #include "components/prefs/pref_service.h" | 47 #include "components/prefs/pref_service.h" |
48 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 48 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
49 #include "components/signin/core/browser/signin_error_controller.h" | 49 #include "components/signin/core/browser/signin_error_controller.h" |
50 #include "components/signin/core/browser/signin_header_helper.h" | 50 #include "components/signin/core/browser/signin_header_helper.h" |
51 #include "components/signin/core/browser/signin_manager.h" | 51 #include "components/signin/core/browser/signin_manager.h" |
52 #include "components/signin/core/common/profile_management_switches.h" | 52 #include "components/signin/core/common/profile_management_switches.h" |
53 #include "components/sync/driver/sync_error_controller.h" | 53 #include "components/sync/driver/sync_error_controller.h" |
54 #include "content/public/browser/render_widget_host_view.h" | 54 #include "content/public/browser/render_widget_host_view.h" |
55 #include "content/public/browser/user_metrics.h" | |
56 #include "third_party/skia/include/core/SkColor.h" | 55 #include "third_party/skia/include/core/SkColor.h" |
57 #include "ui/base/l10n/l10n_util.h" | 56 #include "ui/base/l10n/l10n_util.h" |
58 #include "ui/base/material_design/material_design_controller.h" | 57 #include "ui/base/material_design/material_design_controller.h" |
59 #include "ui/base/resource/resource_bundle.h" | 58 #include "ui/base/resource/resource_bundle.h" |
60 #include "ui/compositor/clip_recorder.h" | 59 #include "ui/compositor/clip_recorder.h" |
61 #include "ui/compositor/paint_recorder.h" | 60 #include "ui/compositor/paint_recorder.h" |
62 #include "ui/gfx/canvas.h" | 61 #include "ui/gfx/canvas.h" |
63 #include "ui/gfx/color_palette.h" | 62 #include "ui/gfx/color_palette.h" |
64 #include "ui/gfx/image/canvas_image_source.h" | 63 #include "ui/gfx/image/canvas_image_source.h" |
65 #include "ui/gfx/image/image.h" | 64 #include "ui/gfx/image/image.h" |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 promo->SetMultiLine(true); | 1420 promo->SetMultiLine(true); |
1422 promo->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 1421 promo->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
1423 extra_links_view->AddChildView(promo); | 1422 extra_links_view->AddChildView(promo); |
1424 | 1423 |
1425 signin_current_profile_button_ = | 1424 signin_current_profile_button_ = |
1426 views::MdTextButton::CreateSecondaryUiBlueButton( | 1425 views::MdTextButton::CreateSecondaryUiBlueButton( |
1427 this, l10n_util::GetStringFUTF16( | 1426 this, l10n_util::GetStringFUTF16( |
1428 IDS_SYNC_START_SYNC_BUTTON_LABEL, | 1427 IDS_SYNC_START_SYNC_BUTTON_LABEL, |
1429 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); | 1428 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); |
1430 extra_links_view->AddChildView(signin_current_profile_button_); | 1429 extra_links_view->AddChildView(signin_current_profile_button_); |
1431 content::RecordAction( | 1430 base::RecordAction( |
1432 base::UserMetricsAction("Signin_Impression_FromAvatarBubbleSignin")); | 1431 base::UserMetricsAction("Signin_Impression_FromAvatarBubbleSignin")); |
1433 extra_links_view->SetBorder(views::CreateEmptyBorder( | 1432 extra_links_view->SetBorder(views::CreateEmptyBorder( |
1434 0, 0, views::kRelatedControlSmallVerticalSpacing, 0)); | 1433 0, 0, views::kRelatedControlSmallVerticalSpacing, 0)); |
1435 view->AddChildView(extra_links_view); | 1434 view->AddChildView(extra_links_view); |
1436 } | 1435 } |
1437 | 1436 |
1438 current_profile_card_->SetAccessibleName( | 1437 current_profile_card_->SetAccessibleName( |
1439 l10n_util::GetStringFUTF16( | 1438 l10n_util::GetStringFUTF16( |
1440 IDS_PROFILES_EDIT_PROFILE_ACCESSIBLE_NAME, profile_name)); | 1439 IDS_PROFILES_EDIT_PROFILE_ACCESSIBLE_NAME, profile_name)); |
1441 return view; | 1440 return view; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1913 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1915 IncognitoModePrefs::DISABLED; | 1914 IncognitoModePrefs::DISABLED; |
1916 return incognito_available && !browser_->profile()->IsGuestSession(); | 1915 return incognito_available && !browser_->profile()->IsGuestSession(); |
1917 } | 1916 } |
1918 | 1917 |
1919 void ProfileChooserView::PostActionPerformed( | 1918 void ProfileChooserView::PostActionPerformed( |
1920 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1919 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1921 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1920 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1922 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1921 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1923 } | 1922 } |
OLD | NEW |