Chromium Code Reviews| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 : parent_(parent), web_view_(web_view), email_address_(email_address) { | 65 : parent_(parent), web_view_(web_view), email_address_(email_address) { |
| 66 AddChildView(web_view_); | 66 AddChildView(web_view_); |
| 67 SetLayoutManager(new views::FillLayout()); | 67 SetLayoutManager(new views::FillLayout()); |
| 68 | 68 |
| 69 web_view_->GetWebContents()->SetDelegate(this); | 69 web_view_->GetWebContents()->SetDelegate(this); |
| 70 web_view_->LoadInitialURL(url); | 70 web_view_->LoadInitialURL(url); |
| 71 } | 71 } |
| 72 | 72 |
| 73 UserManagerProfileDialogDelegate::~UserManagerProfileDialogDelegate() {} | 73 UserManagerProfileDialogDelegate::~UserManagerProfileDialogDelegate() {} |
| 74 | 74 |
| 75 gfx::Size UserManagerProfileDialogDelegate::GetPreferredSize() const { | 75 gfx::Size UserManagerProfileDialogDelegate::GetUnsnappedPreferredSize() const { |
| 76 return switches::UsePasswordSeparatedSigninFlow() | 76 return switches::UsePasswordSeparatedSigninFlow() |
|
Peter Kasting
2017/03/30 00:35:35
The cases in this file really should also have bug
| |
| 77 ? gfx::Size(UserManagerProfileDialog::kDialogWidth, | 77 ? gfx::Size(UserManagerProfileDialog::kDialogWidth, |
| 78 UserManagerProfileDialog::kDialogHeight) | 78 UserManagerProfileDialog::kDialogHeight) |
| 79 : gfx::Size( | 79 : gfx::Size( |
| 80 UserManagerProfileDialog::kPasswordCombinedDialogWidth, | 80 UserManagerProfileDialog::kPasswordCombinedDialogWidth, |
| 81 UserManagerProfileDialog::kPasswordCombinedDialogHeight); | 81 UserManagerProfileDialog::kPasswordCombinedDialogHeight); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void UserManagerProfileDialogDelegate::DisplayErrorMessage() { | 84 void UserManagerProfileDialogDelegate::DisplayErrorMessage() { |
| 85 web_view_->LoadInitialURL(GURL(chrome::kChromeUISigninErrorURL)); | 85 web_view_->LoadInitialURL(GURL(chrome::kChromeUISigninErrorURL)); |
| 86 } | 86 } |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 | 400 |
| 401 bool UserManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 401 bool UserManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 402 int key = accelerator.key_code(); | 402 int key = accelerator.key_code(); |
| 403 int modifier = accelerator.modifiers(); | 403 int modifier = accelerator.modifiers(); |
| 404 DCHECK((key == ui::VKEY_W && modifier == ui::EF_CONTROL_DOWN) || | 404 DCHECK((key == ui::VKEY_W && modifier == ui::EF_CONTROL_DOWN) || |
| 405 (key == ui::VKEY_F4 && modifier == ui::EF_ALT_DOWN)); | 405 (key == ui::VKEY_F4 && modifier == ui::EF_ALT_DOWN)); |
| 406 GetWidget()->Close(); | 406 GetWidget()->Close(); |
| 407 return true; | 407 return true; |
| 408 } | 408 } |
| 409 | 409 |
| 410 gfx::Size UserManagerView::GetPreferredSize() const { | 410 gfx::Size UserManagerView::GetUnsnappedPreferredSize() const { |
| 411 return gfx::Size(UserManager::kWindowWidth, UserManager::kWindowHeight); | 411 return gfx::Size(UserManager::kWindowWidth, UserManager::kWindowHeight); |
| 412 } | 412 } |
| 413 | 413 |
| 414 bool UserManagerView::CanResize() const { | 414 bool UserManagerView::CanResize() const { |
| 415 return true; | 415 return true; |
| 416 } | 416 } |
| 417 | 417 |
| 418 bool UserManagerView::CanMaximize() const { | 418 bool UserManagerView::CanMaximize() const { |
| 419 return true; | 419 return true; |
| 420 } | 420 } |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 448 delegate_->DisplayErrorMessage(); | 448 delegate_->DisplayErrorMessage(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) { | 451 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) { |
| 452 signin_profile_path_ = profile_path; | 452 signin_profile_path_ = profile_path; |
| 453 } | 453 } |
| 454 | 454 |
| 455 base::FilePath UserManagerView::GetSigninProfilePath() { | 455 base::FilePath UserManagerView::GetSigninProfilePath() { |
| 456 return signin_profile_path_; | 456 return signin_profile_path_; |
| 457 } | 457 } |
| OLD | NEW |