OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/safe_browsing/srt_fetcher_win.h" | 5 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "base/version.h" | 32 #include "base/version.h" |
33 #include "base/win/registry.h" | 33 #include "base/win/registry.h" |
34 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
35 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 35 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
37 #include "chrome/browser/profiles/profile_io_data.h" | 37 #include "chrome/browser/profiles/profile_io_data.h" |
38 #include "chrome/browser/safe_browsing/srt_chrome_prompt_impl.h" | 38 #include "chrome/browser/safe_browsing/srt_chrome_prompt_impl.h" |
39 #include "chrome/browser/safe_browsing/srt_client_info_win.h" | 39 #include "chrome/browser/safe_browsing/srt_client_info_win.h" |
40 #include "chrome/browser/safe_browsing/srt_global_error_win.h" | 40 #include "chrome/browser/safe_browsing/srt_global_error_win.h" |
41 #include "chrome/browser/safe_browsing/srt_prompt_controller.h" | |
42 #include "chrome/browser/ui/browser_dialogs.h" | |
41 #include "chrome/browser/ui/browser_finder.h" | 43 #include "chrome/browser/ui/browser_finder.h" |
42 #include "chrome/browser/ui/browser_list.h" | 44 #include "chrome/browser/ui/browser_list.h" |
43 #include "chrome/browser/ui/browser_list_observer.h" | 45 #include "chrome/browser/ui/browser_list_observer.h" |
44 #include "chrome/browser/ui/global_error/global_error_service.h" | 46 #include "chrome/browser/ui/global_error/global_error_service.h" |
45 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 47 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
46 #include "chrome/common/pref_names.h" | 48 #include "chrome/common/pref_names.h" |
47 #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" | 49 #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" |
48 #include "components/component_updater/pref_names.h" | 50 #include "components/component_updater/pref_names.h" |
49 #include "components/data_use_measurement/core/data_use_user_data.h" | 51 #include "components/data_use_measurement/core/data_use_user_data.h" |
50 #include "components/prefs/pref_service.h" | 52 #include "components/prefs/pref_service.h" |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1230 base::win::RegKey srt_cleaner_key; | 1232 base::win::RegKey srt_cleaner_key; |
1231 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), | 1233 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), |
1232 KEY_QUERY_VALUE) == ERROR_SUCCESS && | 1234 KEY_QUERY_VALUE) == ERROR_SUCCESS && |
1233 srt_cleaner_key.GetValueCount() > 0; | 1235 srt_cleaner_key.GetValueCount() > 0; |
1234 } | 1236 } |
1235 | 1237 |
1236 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { | 1238 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { |
1237 g_testing_delegate_ = delegate; | 1239 g_testing_delegate_ = delegate; |
1238 } | 1240 } |
1239 | 1241 |
1242 void DisplayUserInitiatedSRTPromptDialog(base::Closure callback) { | |
1243 Browser* browser = chrome::FindLastActive(); | |
1244 DCHECK(browser); | |
alito
2017/04/14 00:01:18
No need for this DCHECK.
proberge
2017/04/18 19:24:28
Done.
| |
1245 | |
1246 // TODO(proberge): Run the callback with details about whether the user | |
1247 // accepted the prompt, whether the clean was successful and what was | |
1248 // cleaned up. This will involve passing the callback to ShowSRTPrompt. | |
1249 if (browser) | |
1250 chrome::ShowSRTPrompt(browser, new safe_browsing::SRTPromptController()); | |
1251 } | |
1252 | |
1240 } // namespace safe_browsing | 1253 } // namespace safe_browsing |
OLD | NEW |