| 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/chrome_cleaner_dialog.h" | 5 #include "chrome/browser/ui/views/chrome_cleaner_dialog_win.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_cont
roller.h" | 8 #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_cont
roller_win.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "components/constrained_window/constrained_window_views.h" | 12 #include "components/constrained_window/constrained_window_views.h" |
| 13 #include "ui/base/ui_base_types.h" | 13 #include "ui/base/ui_base_types.h" |
| 14 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 16 #include "ui/gfx/text_constants.h" | 16 #include "ui/gfx/text_constants.h" |
| 17 #include "ui/views/controls/button/md_text_button.h" | 17 #include "ui/views/controls/button/md_text_button.h" |
| 18 #include "ui/views/controls/label.h" | 18 #include "ui/views/controls/label.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 DCHECK(button == ui::DIALOG_BUTTON_OK || button == ui::DIALOG_BUTTON_CANCEL); | 97 DCHECK(button == ui::DIALOG_BUTTON_OK || button == ui::DIALOG_BUTTON_CANCEL); |
| 98 DCHECK(controller_); | 98 DCHECK(controller_); |
| 99 | 99 |
| 100 return button == ui::DIALOG_BUTTON_OK | 100 return button == ui::DIALOG_BUTTON_OK |
| 101 ? controller_->GetAcceptButtonLabel() | 101 ? controller_->GetAcceptButtonLabel() |
| 102 : DialogDelegate::GetDialogButtonLabel(button); | 102 : DialogDelegate::GetDialogButtonLabel(button); |
| 103 } | 103 } |
| 104 | 104 |
| 105 views::View* ChromeCleanerDialog::CreateExtraView() { | 105 views::View* ChromeCleanerDialog::CreateExtraView() { |
| 106 return views::MdTextButton::CreateSecondaryUiButton( | 106 return views::MdTextButton::CreateSecondaryUiButton( |
| 107 this, controller_->GetAdvancedButtonLabel()); | 107 this, controller_->GetDetailsButtonLabel()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool ChromeCleanerDialog::Accept() { | 110 bool ChromeCleanerDialog::Accept() { |
| 111 if (controller_) { | 111 if (controller_) { |
| 112 controller_->Accept(); | 112 controller_->Accept(); |
| 113 controller_ = nullptr; | 113 controller_ = nullptr; |
| 114 } | 114 } |
| 115 return true; | 115 return true; |
| 116 } | 116 } |
| 117 | 117 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 139 | 139 |
| 140 // views::ButtonListener overrides. | 140 // views::ButtonListener overrides. |
| 141 | 141 |
| 142 void ChromeCleanerDialog::ButtonPressed(views::Button* sender, | 142 void ChromeCleanerDialog::ButtonPressed(views::Button* sender, |
| 143 const ui::Event& event) { | 143 const ui::Event& event) { |
| 144 DCHECK(browser_); | 144 DCHECK(browser_); |
| 145 | 145 |
| 146 // TODO(alito): Navigate to the webui version of the Chrome Cleaner UI when | 146 // TODO(alito): Navigate to the webui version of the Chrome Cleaner UI when |
| 147 // that is implemented. | 147 // that is implemented. |
| 148 if (controller_) { | 148 if (controller_) { |
| 149 controller_->AdvancedButtonClicked(); | 149 controller_->DetailsButtonClicked(); |
| 150 controller_ = nullptr; | 150 controller_ = nullptr; |
| 151 } | 151 } |
| 152 GetWidget()->Close(); | 152 GetWidget()->Close(); |
| 153 } | 153 } |
| OLD | NEW |