Chromium Code Reviews| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 if (!browser) | 520 if (!browser) |
| 521 return; | 521 return; |
| 522 | 522 |
| 523 Profile* profile = browser->profile(); | 523 Profile* profile = browser->profile(); |
| 524 DCHECK(profile); | 524 DCHECK(profile); |
| 525 | 525 |
| 526 // Make sure we have a tabbed browser since we need to anchor the bubble to | 526 // Make sure we have a tabbed browser since we need to anchor the bubble to |
| 527 // the toolbar's wrench menu. Create one if none exist already. | 527 // the toolbar's wrench menu. Create one if none exist already. |
| 528 if (browser->type() != Browser::TYPE_TABBED) { | 528 if (browser->type() != Browser::TYPE_TABBED) { |
| 529 browser = chrome::FindTabbedBrowser(profile, false); | 529 browser = chrome::FindTabbedBrowser(profile, false); |
| 530 if (!browser) | 530 if (!browser) { |
| 531 browser = new Browser(Browser::CreateParams(profile)); | 531 Browser::CreateParams params = Browser::CreateParams(profile); |
| 532 params.user_gesture = false; | |
|
Mr4D (OOO till 08-26)
2017/02/13 23:57:39
A default of true is odd. But ok
joenotcharles
2017/02/14 00:09:16
I feel like most people who call CreateParms won't
joenotcharles
2017/02/14 00:10:39
(That said, I'm skeptical that plumbing this throu
| |
| 533 browser = new Browser(params); | |
| 534 } | |
| 532 } | 535 } |
| 533 GlobalErrorService* global_error_service = | 536 GlobalErrorService* global_error_service = |
| 534 GlobalErrorServiceFactory::GetForProfile(profile); | 537 GlobalErrorServiceFactory::GetForProfile(profile); |
| 535 SRTGlobalError* global_error = | 538 SRTGlobalError* global_error = |
| 536 new SRTGlobalError(global_error_service, download_path); | 539 new SRTGlobalError(global_error_service, download_path); |
| 537 | 540 |
| 538 // Ownership of |global_error| is passed to the service. The error removes | 541 // Ownership of |global_error| is passed to the service. The error removes |
| 539 // itself from the service and self-destructs when done. | 542 // itself from the service and self-destructs when done. |
| 540 global_error_service->AddGlobalError(base::WrapUnique(global_error)); | 543 global_error_service->AddGlobalError(base::WrapUnique(global_error)); |
| 541 | 544 |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1080 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), | 1083 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), |
| 1081 KEY_QUERY_VALUE) == ERROR_SUCCESS && | 1084 KEY_QUERY_VALUE) == ERROR_SUCCESS && |
| 1082 srt_cleaner_key.GetValueCount() > 0; | 1085 srt_cleaner_key.GetValueCount() > 0; |
| 1083 } | 1086 } |
| 1084 | 1087 |
| 1085 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { | 1088 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { |
| 1086 g_testing_delegate_ = delegate; | 1089 g_testing_delegate_ = delegate; |
| 1087 } | 1090 } |
| 1088 | 1091 |
| 1089 } // namespace safe_browsing | 1092 } // namespace safe_browsing |
| OLD | NEW |