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

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: 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/resources/set_as_default_browser.js ('k') | chrome/browser/shell_integration.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration.h
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 02bbefb5a2b005ea304e23de30495ebac64e6a74..37689c8be65990eac67f8c2ce9067e8af1e7af9c 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -169,12 +169,15 @@ 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; }
+ // freed by the worker when they are no longer needed. False by default.
+ virtual bool IsOwnedByWorker();
// An observer can permit or decline set-as-default operation if it
- // requires triggering user interaction.
- virtual bool IsInteractiveSetDefaultPermitted() { return false; }
+ // requires triggering user interaction. By default not allowed.
+ virtual bool IsInteractiveSetDefaultPermitted();
};
// Helper objects that handle checking if Chrome is the default browser
@@ -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_;
« no previous file with comments | « chrome/browser/resources/set_as_default_browser.js ('k') | chrome/browser/shell_integration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698