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

Unified Diff: chrome/browser/shell_integration.h

Issue 1770943005: Removed AttemptResult enum in favor of using DefaultWebClientState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dont_record_async_duration
Patch Set: Merge + simplified Created 4 years, 9 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 8a1b5756e5a4048b792030eab8f00b8ab980b91a..8e6252b3e9f80e5555aecbb9071d25f5111d7351 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -211,53 +211,13 @@ class DefaultWebClientWorker
protected:
friend class base::RefCountedThreadSafe<DefaultWebClientWorker>;
- // Possible result codes for a set-as-default operation.
- // Do not modify the ordering as it is important for UMA.
- enum AttemptResult {
- // Chrome was set as the default web client.
- SUCCESS = 0,
- // Chrome was already the default web client. This counts as a successful
- // attempt.
- // Note: This result is no longer used since the removal of the Win10
- // default browser experiment.
- // ALREADY_DEFAULT = 1,
- // Chrome was not set as the default web client.
- FAILURE = 2,
- // The attempt was abandoned because the observer was destroyed.
- // Note: This result is no longer used since the removal of
- // DefaultWebClientObserver.
- // ABANDONED = 3,
- // Failed to launch the process to set Chrome as the default web client
- // asynchronously.
- // Note: This result is no longer used since the removal of the Win10
- // default browser experiment.
- // LAUNCH_FAILURE = 4,
- // Another worker is already in progress to make Chrome the default web
- // client.
- // Note: This result is no longer used since the removal of the Win10
- // default browser experiment.
- // OTHER_WORKER = 5,
- // The user initiated another attempt while the asynchronous operation was
- // already in progress.
- RETRY = 6,
- // No errors were encountered yet Chrome is still not the default web
- // client.
- NO_ERRORS_NOT_DEFAULT = 7,
- NUM_ATTEMPT_RESULT_TYPES
- };
-
virtual ~DefaultWebClientWorker();
- // Communicates the result via the |callback_|. In contrast to
- // OnSetAsDefaultAttemptComplete(), this should not be called multiple
- // times.
- void OnCheckIsDefaultComplete(DefaultWebClientState state);
-
- // Called when the set as default operation is completed. This then invokes
- // FinalizeSetAsDefault() and starts the check is default process.
- // It is safe to call this multiple times. Only the first call is processed
- // after StartSetAsDefault() is invoked.
- void OnSetAsDefaultAttemptComplete(AttemptResult result);
+ // Communicates the result via the |callback_|. When
+ // |is_following_set_as_default| is true, |state| will be reported to UMA as
+ // the result of the set-as-default operation.
+ void OnCheckIsDefaultComplete(DefaultWebClientState state,
+ bool is_following_set_as_default);
// When false, the operation to set as default will fail for interactive
// flows.
@@ -266,20 +226,21 @@ class DefaultWebClientWorker
private:
// Checks whether Chrome is the default web client. Always called on the
// FILE thread. Subclasses are responsible for calling
- // OnCheckIsDefaultComplete() on the UI thread.
- virtual void CheckIsDefault() = 0;
+ // OnCheckIsDefaultComplete() on the UI thread. When
+ // |is_following_set_as_default| is true, the default state will be reported
+ // to UMA as the result of the set-as-default operation.
+ virtual void CheckIsDefault(bool is_following_set_as_default) = 0;
// Sets Chrome as the default web client. Always called on the FILE thread.
- // Subclasses are responsible for calling OnSetAsDefaultAttemptComplete() on
- // the UI thread.
+ // Subclasses are responsible for calling CheckIsDefault().
virtual void SetAsDefault() = 0;
// Returns the prefix used for metrics to differentiate UMA metrics for
// setting the default browser and setting the default protocol client.
virtual const char* GetHistogramPrefix() = 0;
- // Reports the result and duration for one set-as-default attempt.
- void ReportAttemptResult(AttemptResult result);
+ // Reports the result for the set-as-default operation.
+ void ReportSetDefaultResult(DefaultWebClientState state);
// Updates the UI in our associated view with the current default web
// client state.
@@ -288,10 +249,6 @@ class DefaultWebClientWorker
// Called with the default state after the worker is done.
DefaultWebClientWorkerCallback callback_;
- // Wait until Chrome has been confirmed as the default browser before
- // reporting a successful attempt.
- bool check_default_should_report_success_ = false;
-
DISALLOW_COPY_AND_ASSIGN(DefaultWebClientWorker);
};
@@ -304,7 +261,7 @@ class DefaultBrowserWorker : public DefaultWebClientWorker {
~DefaultBrowserWorker() override;
// Check if Chrome is the default browser.
- void CheckIsDefault() override;
+ void CheckIsDefault(bool is_following_set_as_default) override;
// Set Chrome as the default browser.
void SetAsDefault() override;
@@ -331,7 +288,7 @@ class DefaultProtocolClientWorker : public DefaultWebClientWorker {
private:
// Check is Chrome is the default handler for this protocol.
- void CheckIsDefault() override;
+ void CheckIsDefault(bool is_following_set_as_default) override;
// Set Chrome as the default handler for this protocol.
void SetAsDefault() override;

Powered by Google App Engine
This is Rietveld 408576698