| 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 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 31 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 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/profile_oauth2_token_service.h" | 37 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 38 #include "components/signin/core/browser/signin_error_controller.h" | 38 #include "components/signin/core/browser/signin_error_controller.h" |
| 39 #include "components/signin/core/browser/signin_manager.h" | 39 #include "components/signin/core/browser/signin_manager.h" |
| 40 #include "components/signin/core/common/profile_management_switches.h" | 40 #include "components/signin/core/common/profile_management_switches.h" |
| 41 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 41 #include "content/public/browser/render_widget_host_view.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/compositor/clip_transform_recorder.h" | 47 #include "ui/compositor/clip_transform_recorder.h" |
| 47 #include "ui/gfx/canvas.h" | 48 #include "ui/gfx/canvas.h" |
| 48 #include "ui/gfx/image/image.h" | 49 #include "ui/gfx/image/image.h" |
| 49 #include "ui/gfx/image/image_skia.h" | 50 #include "ui/gfx/image/image_skia.h" |
| 50 #include "ui/gfx/path.h" | 51 #include "ui/gfx/path.h" |
| (...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 default: | 1531 default: |
| 1531 NOTREACHED() << "Called with invalid mode=" << view_mode_; | 1532 NOTREACHED() << "Called with invalid mode=" << view_mode_; |
| 1532 return NULL; | 1533 return NULL; |
| 1533 } | 1534 } |
| 1534 | 1535 |
| 1535 // Adds Gaia signin webview | 1536 // Adds Gaia signin webview |
| 1536 Profile* profile = browser_->profile(); | 1537 Profile* profile = browser_->profile(); |
| 1537 views::WebView* web_view = new views::WebView(profile); | 1538 views::WebView* web_view = new views::WebView(profile); |
| 1538 web_view->LoadInitialURL(url); | 1539 web_view->LoadInitialURL(url); |
| 1539 web_view->GetWebContents()->SetDelegate(this); | 1540 web_view->GetWebContents()->SetDelegate(this); |
| 1541 web_modal::WebContentsModalDialogManager::CreateForWebContents( |
| 1542 web_view->GetWebContents()); |
| 1543 |
| 1540 web_view->SetPreferredSize( | 1544 web_view->SetPreferredSize( |
| 1541 gfx::Size(kFixedGaiaViewWidth, kFixedGaiaViewHeight)); | 1545 gfx::Size(kFixedGaiaViewWidth, kFixedGaiaViewHeight)); |
| 1542 content::RenderWidgetHostView* rwhv = | 1546 content::RenderWidgetHostView* rwhv = |
| 1543 web_view->GetWebContents()->GetRenderWidgetHostView(); | 1547 web_view->GetWebContents()->GetRenderWidgetHostView(); |
| 1544 if (rwhv) | 1548 if (rwhv) |
| 1545 rwhv->SetBackgroundColor(profiles::kAvatarBubbleGaiaBackgroundColor); | 1549 rwhv->SetBackgroundColor(profiles::kAvatarBubbleGaiaBackgroundColor); |
| 1546 TitleCard* title_card = new TitleCard(l10n_util::GetStringUTF16(message_id), | 1550 TitleCard* title_card = new TitleCard(l10n_util::GetStringUTF16(message_id), |
| 1547 this, | 1551 this, |
| 1548 &gaia_signin_cancel_button_); | 1552 &gaia_signin_cancel_button_); |
| 1549 if (signin_content_view) | 1553 if (signin_content_view) |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1751 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1748 IncognitoModePrefs::DISABLED; | 1752 IncognitoModePrefs::DISABLED; |
| 1749 return incognito_available && !browser_->profile()->IsGuestSession(); | 1753 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1750 } | 1754 } |
| 1751 | 1755 |
| 1752 void ProfileChooserView::PostActionPerformed( | 1756 void ProfileChooserView::PostActionPerformed( |
| 1753 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1757 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1754 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1758 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1755 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1759 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1756 } | 1760 } |
| OLD | NEW |