| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 UserManagerView* parent, | 60 UserManagerView* parent, |
| 61 views::WebView* web_view, | 61 views::WebView* web_view, |
| 62 const std::string& email_address, | 62 const std::string& email_address, |
| 63 const GURL& url) | 63 const GURL& url) |
| 64 : parent_(parent), web_view_(web_view), email_address_(email_address) { | 64 : parent_(parent), web_view_(web_view), email_address_(email_address) { |
| 65 AddChildView(web_view_); | 65 AddChildView(web_view_); |
| 66 SetLayoutManager(new views::FillLayout()); | 66 SetLayoutManager(new views::FillLayout()); |
| 67 | 67 |
| 68 web_view_->GetWebContents()->SetDelegate(this); | 68 web_view_->GetWebContents()->SetDelegate(this); |
| 69 web_view_->LoadInitialURL(url); | 69 web_view_->LoadInitialURL(url); |
| 70 chrome::RecordDialogCreation(chrome::DialogIdentifier::USER_MANAGER_PROFILE); |
| 70 } | 71 } |
| 71 | 72 |
| 72 UserManagerProfileDialogDelegate::~UserManagerProfileDialogDelegate() {} | 73 UserManagerProfileDialogDelegate::~UserManagerProfileDialogDelegate() {} |
| 73 | 74 |
| 74 gfx::Size UserManagerProfileDialogDelegate::GetPreferredSize() const { | 75 gfx::Size UserManagerProfileDialogDelegate::GetPreferredSize() const { |
| 75 return gfx::Size(UserManagerProfileDialog::kDialogWidth, | 76 return gfx::Size(UserManagerProfileDialog::kDialogWidth, |
| 76 UserManagerProfileDialog::kDialogHeight); | 77 UserManagerProfileDialog::kDialogHeight); |
| 77 } | 78 } |
| 78 | 79 |
| 79 void UserManagerProfileDialogDelegate::DisplayErrorMessage() { | 80 void UserManagerProfileDialogDelegate::DisplayErrorMessage() { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 263 } |
| 263 | 264 |
| 264 // UserManagerView ------------------------------------------------------------- | 265 // UserManagerView ------------------------------------------------------------- |
| 265 | 266 |
| 266 UserManagerView::UserManagerView() | 267 UserManagerView::UserManagerView() |
| 267 : web_view_(nullptr), | 268 : web_view_(nullptr), |
| 268 delegate_(nullptr), | 269 delegate_(nullptr), |
| 269 user_manager_started_showing_(base::Time()) { | 270 user_manager_started_showing_(base::Time()) { |
| 270 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::USER_MANAGER_VIEW, | 271 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::USER_MANAGER_VIEW, |
| 271 KeepAliveRestartOption::DISABLED)); | 272 KeepAliveRestartOption::DISABLED)); |
| 273 chrome::RecordDialogCreation(chrome::DialogIdentifier::USER_MANAGER); |
| 272 } | 274 } |
| 273 | 275 |
| 274 UserManagerView::~UserManagerView() { | 276 UserManagerView::~UserManagerView() { |
| 275 HideDialog(); | 277 HideDialog(); |
| 276 } | 278 } |
| 277 | 279 |
| 278 // static | 280 // static |
| 279 void UserManagerView::OnSystemProfileCreated( | 281 void UserManagerView::OnSystemProfileCreated( |
| 280 std::unique_ptr<UserManagerView> instance, | 282 std::unique_ptr<UserManagerView> instance, |
| 281 base::AutoReset<bool>* pending, | 283 base::AutoReset<bool>* pending, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 delegate_->DisplayErrorMessage(); | 445 delegate_->DisplayErrorMessage(); |
| 444 } | 446 } |
| 445 | 447 |
| 446 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) { | 448 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) { |
| 447 signin_profile_path_ = profile_path; | 449 signin_profile_path_ = profile_path; |
| 448 } | 450 } |
| 449 | 451 |
| 450 base::FilePath UserManagerView::GetSigninProfilePath() { | 452 base::FilePath UserManagerView::GetSigninProfilePath() { |
| 451 return signin_profile_path_; | 453 return signin_profile_path_; |
| 452 } | 454 } |
| OLD | NEW |