| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/settings_reset_prompt_dialog.h" | 5 #include "chrome/browser/ui/views/settings_reset_prompt_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom
pt_controller.h" | 7 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom
pt_controller.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 10 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 10 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 bool SettingsResetPromptDialog::ShouldShowWindowIcon() const { | 82 bool SettingsResetPromptDialog::ShouldShowWindowIcon() const { |
| 83 return false; | 83 return false; |
| 84 } | 84 } |
| 85 | 85 |
| 86 base::string16 SettingsResetPromptDialog::GetWindowTitle() const { | 86 base::string16 SettingsResetPromptDialog::GetWindowTitle() const { |
| 87 DCHECK(controller_); | 87 DCHECK(controller_); |
| 88 return controller_->GetWindowTitle(); | 88 return controller_->GetWindowTitle(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 // DialogModel overrides. | |
| 92 | |
| 93 bool SettingsResetPromptDialog::ShouldDefaultButtonBeBlue() const { | |
| 94 return true; | |
| 95 } | |
| 96 | |
| 97 // DialogDelegate overrides. | 91 // DialogDelegate overrides. |
| 98 | 92 |
| 99 base::string16 SettingsResetPromptDialog::GetDialogButtonLabel( | 93 base::string16 SettingsResetPromptDialog::GetDialogButtonLabel( |
| 100 ui::DialogButton button) const { | 94 ui::DialogButton button) const { |
| 101 DCHECK(button == ui::DIALOG_BUTTON_OK || button == ui::DIALOG_BUTTON_CANCEL); | 95 DCHECK(button == ui::DIALOG_BUTTON_OK || button == ui::DIALOG_BUTTON_CANCEL); |
| 102 DCHECK(controller_); | 96 DCHECK(controller_); |
| 103 | 97 |
| 104 if (button == ui::DIALOG_BUTTON_OK) | 98 if (button == ui::DIALOG_BUTTON_OK) |
| 105 return controller_->GetButtonLabel(); | 99 return controller_->GetButtonLabel(); |
| 106 return DialogDelegate::GetDialogButtonLabel(button); | 100 return DialogDelegate::GetDialogButtonLabel(button); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 128 controller_ = nullptr; | 122 controller_ = nullptr; |
| 129 } | 123 } |
| 130 return true; | 124 return true; |
| 131 } | 125 } |
| 132 | 126 |
| 133 // View overrides. | 127 // View overrides. |
| 134 | 128 |
| 135 gfx::Size SettingsResetPromptDialog::CalculatePreferredSize() const { | 129 gfx::Size SettingsResetPromptDialog::CalculatePreferredSize() const { |
| 136 return gfx::Size(kDialogWidth, GetHeightForWidth(kDialogWidth)); | 130 return gfx::Size(kDialogWidth, GetHeightForWidth(kDialogWidth)); |
| 137 } | 131 } |
| OLD | NEW |