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

Unified Diff: chrome/browser/shell_integration.h

Issue 10539169: Prototype version of the first-run dialog for Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gyp wrestling. 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.h
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 02bbefb5a2b005ea304e23de30495ebac64e6a74..2f30cbe09de2cf0e537d3efba3c9d29286d43681 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -169,6 +169,9 @@ class ShellIntegration {
virtual ~DefaultWebClientObserver() {}
// Updates the UI state to reflect the current default browser state.
virtual void SetDefaultWebClientUIState(DefaultWebClientUIState state) = 0;
+ // Called to notify the UI of the immediate result of invoking
+ // SetAsDefault.
+ virtual void OnSetAsDefaultConcluded(bool succeeded) { }
// Observer classes that return true to OwnedByWorker are automatically
// freed by the worker when they are no longer needed.
virtual bool IsOwnedByWorker() { return false; }
@@ -209,8 +212,9 @@ class ShellIntegration {
// Function that performs the check.
virtual DefaultWebClientState CheckIsDefault() = 0;
- // Function that sets Chrome as the default web client.
- virtual void SetAsDefault(bool interactive_permitted) = 0;
+ // Function that sets Chrome as the default web client. Returns false if
+ // the operation fails or has been cancelled by the user.
+ virtual bool SetAsDefault(bool interactive_permitted) = 0;
// Function that handles performing the check on the file thread. This
// function is posted as a task onto the file thread, where it performs
@@ -224,7 +228,10 @@ class ShellIntegration {
// Once it is finished the CompleteSetAsDefault function is posted to the
// UI thread which will check the status of Chrome as the default, and
// send this to the observer.
- void ExecuteSetAsDefault();
+ // |interactive_permitted| indicates if the routine is allowed to carry on
+ // in context where user interaction is required (CanSetAsDefault*
+ // returns SET_DEFAULT_INTERACTIVE).
+ void ExecuteSetAsDefault(bool interactive_permitted);
// Communicate results to the observer. This function is posted as a task
// onto the UI thread by the ExecuteCheckIsDefault function running in the
@@ -236,7 +243,9 @@ class ShellIntegration {
// ExecuteSetAsDefault function running in the file thread. This function
// will the start the check process, which, if an observer is present,
// reports to it the new status.
- void CompleteSetAsDefault();
+ // |succeeded| is true if the actual call to a set-default function (from
+ // ExecuteSetAsDefault) was successful.
+ void CompleteSetAsDefault(bool succeeded);
// Updates the UI in our associated view with the current default web
// client state.
@@ -259,7 +268,7 @@ class ShellIntegration {
virtual DefaultWebClientState CheckIsDefault() OVERRIDE;
// Set Chrome as the default browser.
- virtual void SetAsDefault(bool interactive_permitted) OVERRIDE;
+ virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker);
};
@@ -283,7 +292,7 @@ class ShellIntegration {
virtual DefaultWebClientState CheckIsDefault() OVERRIDE;
// Set Chrome as the default handler for this protocol.
- virtual void SetAsDefault(bool interactive_permitted) OVERRIDE;
+ virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE;
std::string protocol_;

Powered by Google App Engine
This is Rietveld 408576698