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

Unified Diff: chrome/browser/extensions/activity_log/activity_log.h

Issue 18430004: Sets correct ActivityLog enabled status to the first renderer process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/extensions/activity_log/activity_log.h
diff --git a/chrome/browser/extensions/activity_log/activity_log.h b/chrome/browser/extensions/activity_log/activity_log.h
index 19813c28e3a23867231dc4aa9b41985d0914b880..aae3c3a2308f01d96445d9387755dca1870c103b 100644
--- a/chrome/browser/extensions/activity_log/activity_log.h
+++ b/chrome/browser/extensions/activity_log/activity_log.h
@@ -30,6 +30,10 @@
class Profile;
using content::BrowserThread;
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
namespace extensions {
class Extension;
class ActivityLogPolicy;
@@ -56,11 +60,6 @@ class ActivityLog : public BrowserContextKeyedService,
// AL extension *or* set the --enable-extension-activity-logging flag.
bool IsLogEnabled();
- // If you want to know whether the log is enabled but DON'T have a profile
- // object yet, use this method. However, it's preferable for the caller to
- // use IsLogEnabled when possible.
- static bool IsLogEnabledOnAnyProfile();
-
// Add/remove observer: the activityLogPrivate API only listens when the
// ActivityLog extension is registered for an event.
void AddObserver(Observer* observer);
@@ -146,6 +145,8 @@ class ActivityLog : public BrowserContextKeyedService,
// BrowserContextKeyedService
virtual void Shutdown() OVERRIDE;
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
private:
friend class ActivityLogFactory;
friend class ActivityLogTest;
@@ -154,9 +155,9 @@ class ActivityLog : public BrowserContextKeyedService,
explicit ActivityLog(Profile* profile);
virtual ~ActivityLog();
- // Some setup needs to wait until after the ExtensionSystem/ExtensionService
- // are done with their own setup.
- void Init();
+ // Delayed initialization of Install Tracker which waits until after the
+ // ExtensionSystem/ExtensionService are done with their own setup.
+ void InitInstallTracker();
// We log callbacks and API calls very similarly, so we handle them the same
// way internally.
@@ -175,10 +176,6 @@ class ActivityLog : public BrowserContextKeyedService,
int32 page_id,
const GURL& on_url) OVERRIDE;
- // For unit tests only. Does not call Init again!
- // Sets whether logging should be enabled for the whole current profile.
- static void RecomputeLoggingIsEnabled(bool profile_enabled);
-
// At the moment, ActivityLog will use only one policy for summarization.
// These methods are used to choose and set the most appropriate policy.
void ChooseDefaultPolicy();
@@ -199,7 +196,6 @@ class ActivityLog : public BrowserContextKeyedService,
Profile* profile_;
bool enabled_; // Whether logging is currently enabled.
- bool initialized_; // Whether Init() has already been called.
bool policy_chosen_; // Whether we've already set the default policy.
// testing_mode_ controls whether to log API call arguments. By default, we
// don't log most arguments to avoid saving too much data. In testing mode,
@@ -216,6 +212,10 @@ class ActivityLog : public BrowserContextKeyedService,
// added or removed, enabled_ may change.
InstallTracker* tracker_;
+ // Set if the watchdog extension is present and active. Maintained by
+ // kWatchdogExtensionActive pref variable.
+ bool watchdog_extension_active_;
+
DISALLOW_COPY_AND_ASSIGN(ActivityLog);
};

Powered by Google App Engine
This is Rietveld 408576698