| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profile_chooser_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/extension_web_contents_observer.h" |
| 9 #include "chrome/browser/profiles/profile_info_util.h" | 10 #include "chrome/browser/profiles/profile_info_util.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 11 #include "chrome/browser/profiles/profile_window.h" | 12 #include "chrome/browser/profiles/profile_window.h" |
| 12 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
| 13 #include "chrome/browser/signin/mutable_profile_oauth2_token_service.h" | 14 #include "chrome/browser/signin/mutable_profile_oauth2_token_service.h" |
| 14 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 15 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 16 #include "chrome/browser/signin/signin_manager.h" | 17 #include "chrome/browser/signin/signin_manager.h" |
| 17 #include "chrome/browser/signin/signin_manager_factory.h" | 18 #include "chrome/browser/signin/signin_manager_factory.h" |
| 18 #include "chrome/browser/signin/signin_promo.h" | 19 #include "chrome/browser/signin/signin_promo.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 views::GridLayout* layout = CreateSingleColumnLayout(this); | 435 views::GridLayout* layout = CreateSingleColumnLayout(this); |
| 435 layout->set_minimum_size(gfx::Size(kMinMenuWidth, 0)); | 436 layout->set_minimum_size(gfx::Size(kMinMenuWidth, 0)); |
| 436 | 437 |
| 437 if (view_to_display == GAIA_SIGNIN_VIEW || | 438 if (view_to_display == GAIA_SIGNIN_VIEW || |
| 438 view_to_display == GAIA_ADD_ACCOUNT_VIEW) { | 439 view_to_display == GAIA_ADD_ACCOUNT_VIEW) { |
| 439 // Minimum size for embedded sign in pages as defined in Gaia. | 440 // Minimum size for embedded sign in pages as defined in Gaia. |
| 440 const int kMinGaiaViewWidth = 320; | 441 const int kMinGaiaViewWidth = 320; |
| 441 const int kMinGaiaViewHeight = 440; | 442 const int kMinGaiaViewHeight = 440; |
| 442 Profile* profile = browser_->profile(); | 443 Profile* profile = browser_->profile(); |
| 443 views::WebView* web_view = new views::WebView(profile); | 444 views::WebView* web_view = new views::WebView(profile); |
| 445 extensions::ExtensionWebContentsObserver::CreateForWebContents( |
| 446 web_view->GetWebContents()); |
| 444 signin::Source source = (view_to_display == GAIA_SIGNIN_VIEW) ? | 447 signin::Source source = (view_to_display == GAIA_SIGNIN_VIEW) ? |
| 445 signin::SOURCE_AVATAR_BUBBLE_SIGN_IN : | 448 signin::SOURCE_AVATAR_BUBBLE_SIGN_IN : |
| 446 signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT; | 449 signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT; |
| 447 GURL url(signin::GetPromoURL( | 450 GURL url(signin::GetPromoURL( |
| 448 source, false /* auto_close */, true /* is_constrained */)); | 451 source, false /* auto_close */, true /* is_constrained */)); |
| 449 web_view->LoadInitialURL(url); | 452 web_view->LoadInitialURL(url); |
| 450 layout->StartRow(1, 0); | 453 layout->StartRow(1, 0); |
| 451 layout->AddView(web_view); | 454 layout->AddView(web_view); |
| 452 layout->set_minimum_size( | 455 layout->set_minimum_size( |
| 453 gfx::Size(kMinGaiaViewWidth, kMinGaiaViewHeight)); | 456 gfx::Size(kMinGaiaViewWidth, kMinGaiaViewHeight)); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 email_button->set_menu_marker( | 841 email_button->set_menu_marker( |
| 839 rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia()); | 842 rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia()); |
| 840 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 843 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 841 } | 844 } |
| 842 layout->StartRow(1, 0); | 845 layout->StartRow(1, 0); |
| 843 layout->AddView(email_button); | 846 layout->AddView(email_button); |
| 844 | 847 |
| 845 // Save the original email address, as the button text could be elided. | 848 // Save the original email address, as the button text could be elided. |
| 846 current_profile_accounts_map_[email_button] = account; | 849 current_profile_accounts_map_[email_button] = account; |
| 847 } | 850 } |
| OLD | NEW |