| 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/user_manager_view.h" | 5 #include "chrome/browser/ui/views/profiles/user_manager_view.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 base::Closure* user_manager_shown_callback_for_testing_ = nullptr; | 59 base::Closure* user_manager_shown_callback_for_testing_ = nullptr; |
| 60 bool instance_under_construction_ = false; | 60 bool instance_under_construction_ = false; |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 // ReauthDelegate--------------------------------------------------------------- | 63 // ReauthDelegate--------------------------------------------------------------- |
| 64 | 64 |
| 65 ReauthDelegate::ReauthDelegate(UserManagerView* parent, | 65 ReauthDelegate::ReauthDelegate(UserManagerView* parent, |
| 66 views::WebView* web_view, | 66 views::WebView* web_view, |
| 67 const std::string& email_address, | 67 const std::string& email_address, |
| 68 signin_metrics::Reason reason) | 68 signin_metrics::Reason reason) |
| 69 : UserManager::ReauthDialogObserver(web_view->GetWebContents(), | 69 : parent_(parent), |
| 70 email_address), | |
| 71 parent_(parent), | |
| 72 web_view_(web_view), | 70 web_view_(web_view), |
| 73 email_address_(email_address) { | 71 email_address_(email_address) { |
| 74 AddChildView(web_view_); | 72 AddChildView(web_view_); |
| 75 SetLayoutManager(new views::FillLayout()); | 73 SetLayoutManager(new views::FillLayout()); |
| 76 | 74 |
| 75 web_view->GetWebContents()->SetDelegate(this); |
| 76 |
| 77 // Load the re-auth URL, prepopulated with the user's email address. | 77 // Load the re-auth URL, prepopulated with the user's email address. |
| 78 // Add the index of the profile to the URL so that the inline login page | 78 // Add the index of the profile to the URL so that the inline login page |
| 79 // knows which profile to load and update the credentials. | 79 // knows which profile to load and update the credentials. |
| 80 GURL url = signin::GetReauthURLWithEmail( | 80 GURL url = signin::GetReauthURLWithEmail( |
| 81 signin_metrics::AccessPoint::ACCESS_POINT_USER_MANAGER, reason, | 81 signin_metrics::AccessPoint::ACCESS_POINT_USER_MANAGER, reason, |
| 82 email_address_); | 82 email_address_); |
| 83 web_view_->LoadInitialURL(url); | 83 web_view_->LoadInitialURL(url); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ReauthDelegate::~ReauthDelegate() {} | 86 ReauthDelegate::~ReauthDelegate() {} |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 // Now that the window is closed, we can allow a new one to be opened. | 415 // Now that the window is closed, we can allow a new one to be opened. |
| 416 // (WindowClosing comes in asynchronously from the call to Close() and we | 416 // (WindowClosing comes in asynchronously from the call to Close() and we |
| 417 // may have already opened a new instance). | 417 // may have already opened a new instance). |
| 418 if (instance_ == this) | 418 if (instance_ == this) |
| 419 instance_ = NULL; | 419 instance_ = NULL; |
| 420 } | 420 } |
| 421 | 421 |
| 422 bool UserManagerView::ShouldUseCustomFrame() const { | 422 bool UserManagerView::ShouldUseCustomFrame() const { |
| 423 return false; | 423 return false; |
| 424 } | 424 } |
| OLD | NEW |