OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/safe_browsing/srt_prompt_controller.h" | |
6 | |
7 #include "base/strings/utf_string_conversions.h" | |
8 | |
9 namespace safe_browsing { | |
10 | |
11 namespace { | |
12 | |
13 // Some dummy strings to be displayed in the Cleaner dialog while iterating on | |
14 // the dialog's UX design and work on the Chrome<->Cleaner IPC is ongoing. | |
15 constexpr char kWindowTitle[] = "Clean up your computer?"; | |
16 constexpr char kMainText[] = | |
17 "Chrome found software that harms your browsing experience. Remove related " | |
18 "files from your computer and restore browser settings, including your " | |
19 "search engine and home page."; | |
20 constexpr char kAcceptButtonLabel[] = "Cleanup"; | |
21 constexpr char kAdvancedButtonLabel[] = "Advanced"; | |
22 | |
23 } // namespace | |
24 | |
25 SRTPromptController::SRTPromptController() {} | |
26 | |
27 SRTPromptController::~SRTPromptController() = default; | |
28 | |
29 base::string16 SRTPromptController::GetWindowTitle() const { | |
30 return base::UTF8ToUTF16(kWindowTitle); | |
31 } | |
32 | |
33 base::string16 SRTPromptController::GetMainText() const { | |
34 return base::UTF8ToUTF16(kMainText); | |
35 } | |
36 | |
37 base::string16 SRTPromptController::GetAcceptButtonLabel() const { | |
38 return base::UTF8ToUTF16(kAcceptButtonLabel); | |
39 } | |
40 | |
41 base::string16 SRTPromptController::GetAdvancedButtonLabel() const { | |
42 return base::UTF8ToUTF16(kAdvancedButtonLabel); | |
43 } | |
44 | |
45 void SRTPromptController::DialogShown() {} | |
46 | |
47 void SRTPromptController::Accept() { | |
48 OnInteractionDone(); | |
49 } | |
50 | |
51 void SRTPromptController::Cancel() { | |
52 OnInteractionDone(); | |
53 } | |
54 | |
55 void SRTPromptController::Close() { | |
56 OnInteractionDone(); | |
57 } | |
58 | |
59 void SRTPromptController::AdvancedButtonClicked() { | |
60 OnInteractionDone(); | |
61 } | |
62 | |
63 void SRTPromptController::OnInteractionDone() { | |
64 delete this; | |
65 } | |
66 | |
67 } // namespace safe_browsing | |
OLD | NEW |