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 #ifndef CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" | 9 #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" |
9 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
10 | 11 |
11 namespace safe_browsing { | 12 namespace safe_browsing { |
12 | 13 |
13 // Implementation of the ChromePrompt Mojo interface. | 14 // Implementation of the ChromePrompt Mojo interface. |
14 class ChromePromptImpl : public chrome_cleaner::mojom::ChromePrompt { | 15 class ChromePromptImpl : public chrome_cleaner::mojom::ChromePrompt { |
15 public: | 16 public: |
16 explicit ChromePromptImpl(chrome_cleaner::mojom::ChromePromptRequest request); | 17 explicit ChromePromptImpl(chrome_cleaner::mojom::ChromePromptRequest request); |
17 ~ChromePromptImpl() override; | 18 ~ChromePromptImpl() override; |
18 | 19 |
19 void PromptUser( | 20 void PromptUser( |
20 std::vector<chrome_cleaner::mojom::UwSPtr> removable_uws_found, | 21 std::vector<chrome_cleaner::mojom::UwSPtr> removable_uws_found, |
21 chrome_cleaner::mojom::ElevationStatus elevation_status, | 22 chrome_cleaner::mojom::ElevationStatus elevation_status, |
22 const chrome_cleaner::mojom::ChromePrompt::PromptUserCallback& callback) | 23 const chrome_cleaner::mojom::ChromePrompt::PromptUserCallback& callback) |
23 override; | 24 override; |
24 | 25 |
| 26 // Handles the case when the remote end has been closed, by performing the |
| 27 // necessary cleanups if the prompt dialog is being shown to the user. |
| 28 virtual void OnConnectionClosed(); |
| 29 |
| 30 // Handles the case when a mojo::ReportBadMessage has been explicitly |
| 31 // reported. |
| 32 virtual void OnConnectionError(const std::string& message); |
| 33 |
25 private: | 34 private: |
26 mojo::Binding<chrome_cleaner::mojom::ChromePrompt> binding_; | 35 mojo::Binding<chrome_cleaner::mojom::ChromePrompt> binding_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ChromePromptImpl); |
27 }; | 38 }; |
28 | 39 |
29 } // namespace safe_browsing | 40 } // namespace safe_browsing |
30 | 41 |
31 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ | 42 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_CHROME_PROMPT_IMPL_H_ |
OLD | NEW |