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

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: Addressed some of reviewer's remarks. 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 a1ce234b3a90fb0ef6aa8be11baa389558659806..3412276344022f17413f1cdf7e2b7fe062ce4532 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -162,11 +162,23 @@ class ShellIntegration {
STATE_UNKNOWN
};
+ // The result of invoking SetAsDefault operation from within a
+ // DefaultWebClientWorker implementation. Note that from this result we
+ // cannot really infere if Chrome indeed become the default, because
grt (UTC plus 2) 2012/06/19 20:43:09 infere -> infer
motek. 2012/06/20 16:02:15 This is gone.
+ // in the interactive mode user could ended up chosing a different client.
+ enum SetDefaultWebClientResult {
+ RESULT_SET_DEFAULT_OK,
+ RESULT_SET_DEFAULT_FAILED_OR_CANCELLED,
+ RESULT_SET_DEFAULT_UNDEFINED,
+ };
+
class DefaultWebClientObserver {
public:
virtual ~DefaultWebClientObserver() {}
// Updates the UI state to reflect the current default browser state.
- virtual void SetDefaultWebClientUIState(DefaultWebClientUIState state) = 0;
+ virtual void SetDefaultWebClientUIState(
+ DefaultWebClientUIState state,
+ SetDefaultWebClientResult call_result) = 0;
// Observer classes that return true to OwnedByWorker are automatically
// freed by the worker when they are no longer needed.
virtual bool IsOwnedByWorker() { return false; }
@@ -208,14 +220,19 @@ class ShellIntegration {
virtual DefaultWebClientState CheckIsDefault() = 0;
// Function that sets Chrome as the default web client.
- virtual void SetAsDefault(bool interactive_permitted) = 0;
+ virtual SetDefaultWebClientResult SetAsDefault(
+ bool interactive_permitted) = 0;
+
+ // Private version takes a call result to be eventually forwarded to the
+ // observer.
+ void StartCheckIsDefault(SetDefaultWebClientResult call_result);
// Function that handles performing the check on the file thread. This
// function is posted as a task onto the file thread, where it performs
// the check. When the check has finished the CompleteCheckIsDefault
// function is posted to the UI thread, where the result is sent back to
// the observer.
- void ExecuteCheckIsDefault();
+ void ExecuteCheckIsDefault(SetDefaultWebClientResult call_result);
// Function that handles setting Chrome as the default web client on the
// file thread. This function is posted as a task onto the file thread.
@@ -227,18 +244,20 @@ class ShellIntegration {
// Communicate results to the observer. This function is posted as a task
// onto the UI thread by the ExecuteCheckIsDefault function running in the
// file thread.
- void CompleteCheckIsDefault(DefaultWebClientState state);
+ void CompleteCheckIsDefault(DefaultWebClientState state,
+ SetDefaultWebClientResult call_result);
// When the action to set Chrome as the default has completed this function
// is run. It is posted as a task back onto the UI thread by the
// 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();
+ void CompleteSetAsDefault(SetDefaultWebClientResult call_result);
// Updates the UI in our associated view with the current default web
// client state.
- void UpdateUI(DefaultWebClientState state);
+ void UpdateUI(DefaultWebClientState state,
+ SetDefaultWebClientResult call_result);
DefaultWebClientObserver* observer_;
@@ -257,7 +276,8 @@ class ShellIntegration {
virtual DefaultWebClientState CheckIsDefault() OVERRIDE;
// Set Chrome as the default browser.
- virtual void SetAsDefault(bool interactive_permitted) OVERRIDE;
+ virtual SetDefaultWebClientResult SetAsDefault(
+ bool interactive_permitted) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker);
};
@@ -281,7 +301,8 @@ class ShellIntegration {
virtual DefaultWebClientState CheckIsDefault() OVERRIDE;
// Set Chrome as the default handler for this protocol.
- virtual void SetAsDefault(bool interactive_permitted) OVERRIDE;
+ virtual SetDefaultWebClientResult SetAsDefault(
+ bool interactive_permitted) OVERRIDE;
std::string protocol_;

Powered by Google App Engine
This is Rietveld 408576698