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

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: Update after owners' review. 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
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration.cc
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index fa6dc3f028cd01d7d02246c38c555cc0295d3643..ee27074cb54d59a0c0e661b9263102892fb00f1e 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -102,6 +102,15 @@ bool ShellIntegration::SetAsDefaultBrowserInteractive() {
}
#endif
+bool ShellIntegration::DefaultWebClientObserver::IsOwnedByWorker() {
+ return false;
+}
+
+bool ShellIntegration::DefaultWebClientObserver::
+ IsInteractiveSetDefaultPermitted() {
+ return false;
+}
+
///////////////////////////////////////////////////////////////////////////////
// ShellIntegration::DefaultWebClientWorker
//
@@ -122,13 +131,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 +173,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 +229,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 +265,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_);
}
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698