| 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/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 32 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 32 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" | 
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" | 
| 35 #include "chrome/grit/chromium_strings.h" | 35 #include "chrome/grit/chromium_strings.h" | 
| 36 #include "chrome/grit/generated_resources.h" | 36 #include "chrome/grit/generated_resources.h" | 
| 37 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" | 37 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" | 
| 38 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 38 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 
| 39 #include "components/signin/core/browser/signin_error_controller.h" | 39 #include "components/signin/core/browser/signin_error_controller.h" | 
| 40 #include "components/signin/core/browser/signin_manager.h" | 40 #include "components/signin/core/browser/signin_manager.h" | 
| 41 #include "components/signin/core/common/profile_management_switches.h" | 41 #include "components/signin/core/common/profile_management_switches.h" | 
|  | 42 #include "content/public/browser/render_widget_host_view.h" | 
| 42 #include "grit/theme_resources.h" | 43 #include "grit/theme_resources.h" | 
| 43 #include "third_party/skia/include/core/SkColor.h" | 44 #include "third_party/skia/include/core/SkColor.h" | 
| 44 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" | 
| 45 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" | 
| 46 #include "ui/gfx/canvas.h" | 47 #include "ui/gfx/canvas.h" | 
| 47 #include "ui/gfx/image/image.h" | 48 #include "ui/gfx/image/image.h" | 
| 48 #include "ui/gfx/image/image_skia.h" | 49 #include "ui/gfx/image/image_skia.h" | 
| 49 #include "ui/gfx/path.h" | 50 #include "ui/gfx/path.h" | 
| 50 #include "ui/gfx/skia_util.h" | 51 #include "ui/gfx/skia_util.h" | 
| 51 #include "ui/gfx/text_elider.h" | 52 #include "ui/gfx/text_elider.h" | 
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1439       NOTREACHED() << "Called with invalid mode=" << view_mode_; | 1440       NOTREACHED() << "Called with invalid mode=" << view_mode_; | 
| 1440       return NULL; | 1441       return NULL; | 
| 1441   } | 1442   } | 
| 1442 | 1443 | 
| 1443   // Adds Gaia signin webview | 1444   // Adds Gaia signin webview | 
| 1444   Profile* profile = browser_->profile(); | 1445   Profile* profile = browser_->profile(); | 
| 1445   views::WebView* web_view = new views::WebView(profile); | 1446   views::WebView* web_view = new views::WebView(profile); | 
| 1446   web_view->LoadInitialURL(url); | 1447   web_view->LoadInitialURL(url); | 
| 1447   web_view->SetPreferredSize( | 1448   web_view->SetPreferredSize( | 
| 1448       gfx::Size(kFixedGaiaViewWidth, kFixedGaiaViewHeight)); | 1449       gfx::Size(kFixedGaiaViewWidth, kFixedGaiaViewHeight)); | 
| 1449 | 1450   content::RenderWidgetHostView* rwhv = | 
|  | 1451       web_view->GetWebContents()->GetRenderWidgetHostView(); | 
|  | 1452   if (rwhv) | 
|  | 1453     rwhv->SetBackgroundColor(profiles::kAvatarBubbleGaiaBackgroundColor); | 
| 1450   TitleCard* title_card = new TitleCard(l10n_util::GetStringUTF16(message_id), | 1454   TitleCard* title_card = new TitleCard(l10n_util::GetStringUTF16(message_id), | 
| 1451                                         this, | 1455                                         this, | 
| 1452                                         &gaia_signin_cancel_button_); | 1456                                         &gaia_signin_cancel_button_); | 
| 1453   return TitleCard::AddPaddedTitleCard( | 1457   return TitleCard::AddPaddedTitleCard( | 
| 1454       web_view, title_card, kFixedGaiaViewWidth); | 1458       web_view, title_card, kFixedGaiaViewWidth); | 
| 1455 } | 1459 } | 
| 1456 | 1460 | 
| 1457 views::View* ProfileChooserView::CreateAccountRemovalView() { | 1461 views::View* ProfileChooserView::CreateAccountRemovalView() { | 
| 1458   views::View* view = new views::View(); | 1462   views::View* view = new views::View(); | 
| 1459   views::GridLayout* layout = CreateSingleColumnLayout( | 1463   views::GridLayout* layout = CreateSingleColumnLayout( | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1650       IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1654       IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 
| 1651           IncognitoModePrefs::DISABLED; | 1655           IncognitoModePrefs::DISABLED; | 
| 1652   return incognito_available && !browser_->profile()->IsGuestSession(); | 1656   return incognito_available && !browser_->profile()->IsGuestSession(); | 
| 1653 } | 1657 } | 
| 1654 | 1658 | 
| 1655 void ProfileChooserView::PostActionPerformed( | 1659 void ProfileChooserView::PostActionPerformed( | 
| 1656     ProfileMetrics::ProfileDesktopMenu action_performed) { | 1660     ProfileMetrics::ProfileDesktopMenu action_performed) { | 
| 1657   ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1661   ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 
| 1658   gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1662   gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 
| 1659 } | 1663 } | 
| OLD | NEW | 
|---|