Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2923)

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 1397563002: Setting chrome as the default browser is now fixed on Windows 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/external_protocol/external_protocol_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
index f246291f46b1c3ce59aa09842efc656f7e161598..7d89c81790a0cfd5ab699d6bfae70972ae5c7b07 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
@@ -226,15 +226,24 @@ class FakeProtocolClientWorker
private:
~FakeProtocolClientWorker() override {}
- ShellIntegration::DefaultWebClientState CheckIsDefault() override {
- if (force_failure_) {
- return ShellIntegration::NOT_DEFAULT;
- } else {
- return ShellIntegration::IS_DEFAULT;
- }
+ void CheckIsDefault() override {
+ ShellIntegration::DefaultWebClientState state =
+ ShellIntegration::IS_DEFAULT;
+ if (force_failure_)
+ state = ShellIntegration::NOT_DEFAULT;
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&FakeProtocolClientWorker::OnCheckIsDefaultComplete, this,
+ state));
}
- bool SetAsDefault(bool interactive_permitted) override { return true; }
+ void SetAsDefault(bool interactive_permitted) override {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&FakeProtocolClientWorker::OnSetAsDefaultAttemptComplete,
+ this, AttemptResult::SUCCESS));
+ }
private:
bool force_failure_;
« no previous file with comments | « no previous file | chrome/browser/external_protocol/external_protocol_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698