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

Unified Diff: chrome/browser/shell_integration.cc

Issue 1832853003: DefaultBrowserWorker now fully supports opening the settings for Win10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: chrome/browser/shell_integration.cc
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index 43b6dbc0f7b12996f3932b5154e54771661f3e3d..562b0c8213a5a883ad95e7a18a08bf296462dfde 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -45,6 +45,11 @@ bool SetAsDefaultBrowserInteractive() {
return false;
}
+void SetAsDefaultBrowserUsingSystemSettings(
+ base::Closure on_finished_callback) {
+ NOTREACHED();
+}
grt (UTC plus 2) 2016/03/29 16:45:02 should this also: on_finished_callback.Run(); si
Patrick Monette 2016/03/29 17:43:08 Done.
+
bool SetAsDefaultProtocolClientInteractive(const std::string& protocol) {
return false;
}
@@ -187,8 +192,10 @@ void DefaultWebClientWorker::CheckIsDefault(bool is_following_set_as_default) {
void DefaultWebClientWorker::SetAsDefault() {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
- SetAsDefaultImpl();
- CheckIsDefault(true);
+
+ // SetAsDefaultImpl will make sure the callback is executed exactly once.
+ SetAsDefaultImpl(
+ base::Bind(&DefaultWebClientWorker::CheckIsDefault, this, true));
}
void DefaultWebClientWorker::ReportSetDefaultResult(
@@ -237,7 +244,8 @@ DefaultWebClientState DefaultBrowserWorker::CheckIsDefaultImpl() {
return GetDefaultBrowser();
}
-void DefaultBrowserWorker::SetAsDefaultImpl() {
+void DefaultBrowserWorker::SetAsDefaultImpl(
+ base::Closure on_finished_callback) {
switch (CanSetAsDefaultBrowser()) {
case SET_DEFAULT_NOT_ALLOWED:
NOTREACHED();
@@ -249,7 +257,15 @@ void DefaultBrowserWorker::SetAsDefaultImpl() {
if (interactive_permitted_)
SetAsDefaultBrowserInteractive();
break;
+#if defined(OS_WIN)
grt (UTC plus 2) 2016/03/29 16:45:02 can this not be removed? i think it's nice to redu
Patrick Monette 2016/03/29 17:43:08 Done.
+ case SET_DEFAULT_OPEN_SETTINGS:
+ if (interactive_permitted_) {
+ SetAsDefaultBrowserUsingSystemSettings(on_finished_callback);
+ return;
+ }
+#endif // defined(OS_WIN)
}
+ on_finished_callback.Run();
}
///////////////////////////////////////////////////////////////////////////////
@@ -274,7 +290,8 @@ DefaultWebClientState DefaultProtocolClientWorker::CheckIsDefaultImpl() {
return IsDefaultProtocolClient(protocol_);
}
-void DefaultProtocolClientWorker::SetAsDefaultImpl() {
+void DefaultProtocolClientWorker::SetAsDefaultImpl(
+ base::Closure on_finished_callback) {
switch (CanSetAsDefaultProtocolClient()) {
case SET_DEFAULT_NOT_ALLOWED:
// Not allowed, do nothing.
@@ -283,11 +300,15 @@ void DefaultProtocolClientWorker::SetAsDefaultImpl() {
SetAsDefaultProtocolClient(protocol_);
break;
case SET_DEFAULT_INTERACTIVE:
- if (interactive_permitted_) {
+#if defined(OS_WIN)
+ case SET_DEFAULT_OPEN_SETTINGS:
+// TODO(pmonette): Implement this for Windows 10.
+#endif // defined(OS_WIN)
+ if (interactive_permitted_)
SetAsDefaultProtocolClientInteractive(protocol_);
- }
break;
}
+ on_finished_callback.Run();
}
} // namespace shell_integration

Powered by Google App Engine
This is Rietveld 408576698