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

Unified Diff: chrome/browser/shell_integration.cc

Issue 10539169: Prototype version of the first-run dialog for Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed up a comment. Created 8 years, 6 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 fa6dc3f028cd01d7d02246c38c555cc0295d3643..2b052f467a38a25d7f4142cd7ac50a9c2836f0a4 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -122,13 +122,15 @@ void ShellIntegration::DefaultWebClientWorker::StartCheckIsDefault() {
}
void ShellIntegration::DefaultWebClientWorker::StartSetAsDefault() {
+ bool interactive_permitted = false;
if (observer_) {
observer_->SetDefaultWebClientUIState(STATE_PROCESSING);
+ interactive_permitted = observer_->IsInteractiveSetDefaultPermitted();
}
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- base::Bind(
- &DefaultWebClientWorker::ExecuteSetAsDefault, this));
+ base::Bind(&DefaultWebClientWorker::ExecuteSetAsDefault, this,
+ interactive_permitted));
}
void ShellIntegration::DefaultWebClientWorker::ObserverDestroyed() {
@@ -162,17 +164,22 @@ void ShellIntegration::DefaultWebClientWorker::CompleteCheckIsDefault(
}
}
-void ShellIntegration::DefaultWebClientWorker::ExecuteSetAsDefault() {
+void ShellIntegration::DefaultWebClientWorker::ExecuteSetAsDefault(
+ bool interactive_permitted) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- SetAsDefault(observer_ && observer_->IsInteractiveSetDefaultPermitted());
+
+ bool result = SetAsDefault(interactive_permitted);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(
- &DefaultWebClientWorker::CompleteSetAsDefault, this));
+ base::Bind(&DefaultWebClientWorker::CompleteSetAsDefault, this, result));
}
-void ShellIntegration::DefaultWebClientWorker::CompleteSetAsDefault() {
+void ShellIntegration::DefaultWebClientWorker::CompleteSetAsDefault(
+ bool succeeded) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ // First tell the observer what the SetAsDefault call has returned.
+ if (observer_)
+ observer_->OnSetAsDefaultConcluded(succeeded);
// Set as default completed, check again to make sure it stuck...
StartCheckIsDefault();
}
@@ -213,19 +220,22 @@ ShellIntegration::DefaultBrowserWorker::CheckIsDefault() {
return ShellIntegration::IsDefaultBrowser();
}
-void ShellIntegration::DefaultBrowserWorker::SetAsDefault(
+bool ShellIntegration::DefaultBrowserWorker::SetAsDefault(
bool interactive_permitted) {
+ bool result = false;
switch (ShellIntegration::CanSetAsDefaultBrowser()) {
case ShellIntegration::SET_DEFAULT_UNATTENDED:
- ShellIntegration::SetAsDefaultBrowser();
+ result = ShellIntegration::SetAsDefaultBrowser();
break;
case ShellIntegration::SET_DEFAULT_INTERACTIVE:
if (interactive_permitted)
- ShellIntegration::SetAsDefaultBrowserInteractive();
+ result = ShellIntegration::SetAsDefaultBrowserInteractive();
break;
default:
NOTREACHED();
}
+
+ return result;
}
///////////////////////////////////////////////////////////////////////////////
@@ -246,7 +256,7 @@ ShellIntegration::DefaultProtocolClientWorker::CheckIsDefault() {
return ShellIntegration::IsDefaultProtocolClient(protocol_);
}
-void ShellIntegration::DefaultProtocolClientWorker::SetAsDefault(
+bool ShellIntegration::DefaultProtocolClientWorker::SetAsDefault(
bool interactive_permitted) {
- ShellIntegration::SetAsDefaultProtocolClient(protocol_);
+ return ShellIntegration::SetAsDefaultProtocolClient(protocol_);
}

Powered by Google App Engine
This is Rietveld 408576698