| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 views::BubbleBorder::Arrow arrow, | 491 views::BubbleBorder::Arrow arrow, |
| 492 Browser* browser, | 492 Browser* browser, |
| 493 profiles::BubbleViewMode view_mode, | 493 profiles::BubbleViewMode view_mode, |
| 494 signin::GAIAServiceType service_type) | 494 signin::GAIAServiceType service_type) |
| 495 : BubbleDelegateView(anchor_view, arrow), | 495 : BubbleDelegateView(anchor_view, arrow), |
| 496 browser_(browser), | 496 browser_(browser), |
| 497 view_mode_(view_mode), | 497 view_mode_(view_mode), |
| 498 tutorial_mode_(profiles::TUTORIAL_MODE_NONE), | 498 tutorial_mode_(profiles::TUTORIAL_MODE_NONE), |
| 499 gaia_service_type_(service_type) { | 499 gaia_service_type_(service_type) { |
| 500 // Reset the default margins inherited from the BubbleDelegateView. | 500 // Reset the default margins inherited from the BubbleDelegateView. |
| 501 // Add a small top/bottom inset so that the bubble's rounded corners show up. | 501 // Add a small bottom inset so that the bubble's rounded corners show up. |
| 502 set_margins(gfx::Insets(1, 0, 1, 0)); | 502 set_margins(gfx::Insets(0, 0, 1, 0)); |
| 503 set_background(views::Background::CreateSolidBackground( | 503 set_background(views::Background::CreateSolidBackground( |
| 504 GetNativeTheme()->GetSystemColor( | 504 GetNativeTheme()->GetSystemColor( |
| 505 ui::NativeTheme::kColorId_DialogBackground))); | 505 ui::NativeTheme::kColorId_DialogBackground))); |
| 506 ResetView(); | 506 ResetView(); |
| 507 | 507 |
| 508 avatar_menu_.reset(new AvatarMenu( | 508 avatar_menu_.reset(new AvatarMenu( |
| 509 &g_browser_process->profile_manager()->GetProfileInfoCache(), | 509 &g_browser_process->profile_manager()->GetProfileInfoCache(), |
| 510 this, | 510 this, |
| 511 browser_)); | 511 browser_)); |
| 512 avatar_menu_->RebuildMenu(); | 512 avatar_menu_->RebuildMenu(); |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 profiles::kAvatarTutorialBackgroundColor)); | 925 profiles::kAvatarTutorialBackgroundColor)); |
| 926 views::GridLayout* layout = CreateSingleColumnLayout(view, | 926 views::GridLayout* layout = CreateSingleColumnLayout(view, |
| 927 kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); | 927 kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); |
| 928 layout->SetInsets(views::kButtonVEdgeMarginNew, | 928 layout->SetInsets(views::kButtonVEdgeMarginNew, |
| 929 views::kButtonHEdgeMarginNew, | 929 views::kButtonHEdgeMarginNew, |
| 930 views::kButtonVEdgeMarginNew, | 930 views::kButtonVEdgeMarginNew, |
| 931 views::kButtonHEdgeMarginNew); | 931 views::kButtonHEdgeMarginNew); |
| 932 | 932 |
| 933 // Adds title. | 933 // Adds title. |
| 934 views::Label* title_label = new views::Label(title_text); | 934 views::Label* title_label = new views::Label(title_text); |
| 935 title_label->SetMultiLine(true); |
| 935 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 936 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 936 title_label->SetAutoColorReadabilityEnabled(false); | 937 title_label->SetAutoColorReadabilityEnabled(false); |
| 937 title_label->SetEnabledColor(SK_ColorWHITE); | 938 title_label->SetEnabledColor(SK_ColorWHITE); |
| 938 title_label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 939 title_label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 939 ui::ResourceBundle::MediumFont)); | 940 ui::ResourceBundle::MediumFont)); |
| 940 layout->StartRow(1, 0); | 941 layout->StartRow(1, 0); |
| 941 layout->AddView(title_label); | 942 layout->AddView(title_label); |
| 942 | 943 |
| 943 // Adds body content. | 944 // Adds body content. |
| 944 views::Label* content_label = new views::Label(content_text); | 945 views::Label* content_label = new views::Label(content_text); |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1498 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1498 IncognitoModePrefs::DISABLED; | 1499 IncognitoModePrefs::DISABLED; |
| 1499 return incognito_available && !browser_->profile()->IsGuestSession(); | 1500 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1500 } | 1501 } |
| 1501 | 1502 |
| 1502 void ProfileChooserView::PostActionPerformed( | 1503 void ProfileChooserView::PostActionPerformed( |
| 1503 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1504 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1504 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1505 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1505 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1506 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1506 } | 1507 } |
| OLD | NEW |