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

Unified Diff: chrome/browser/google/google_url_tracker_navigation_helper.h

Issue 283413002: Turn GoogleURLTrackerNavigationHelper(Impl) into a per-tab object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 7 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/google/google_url_tracker_navigation_helper.h
diff --git a/chrome/browser/google/google_url_tracker_navigation_helper.h b/chrome/browser/google/google_url_tracker_navigation_helper.h
index 26b7a5348762a03183fa1147e7fcec73aa292250..98804cebfd9ff946d3f2de27b8347f140cae8336 100644
--- a/chrome/browser/google/google_url_tracker_navigation_helper.h
+++ b/chrome/browser/google/google_url_tracker_navigation_helper.h
@@ -5,46 +5,42 @@
#ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
#define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
-class GoogleURLTracker;
-class InfoBarService;
-class Profile;
+#include "base/macros.h"
-namespace content {
-class NavigationController;
-}
+class GoogleURLTracker;
// A helper class for GoogleURLTracker that abstracts the details of listening
// for various navigation events.
class GoogleURLTrackerNavigationHelper {
public:
- virtual ~GoogleURLTrackerNavigationHelper() {}
+ explicit GoogleURLTrackerNavigationHelper(
+ GoogleURLTracker* google_url_tracker);
+ virtual ~GoogleURLTrackerNavigationHelper();
- // Sets the GoogleURLTracker that is associated with this object.
- virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) = 0;
+ // Enables or disables listening for navigation commits.
+ // OnNavigationCommitted will be called for each navigation commit if
+ // listening is enabled.
+ virtual void SetListeningForNavigationCommit(bool listen) = 0;
- // Enables or disables listening for navigation commits for the given
- // NavigationController. OnNavigationCommitted will be called for each
- // navigation commit if listening is enabled.
- virtual void SetListeningForNavigationCommit(
- const content::NavigationController* nav_controller,
- bool listen) = 0;
+ // Returns whether or not this object is currently listening for navigation
+ // commits.
+ virtual bool IsListeningForNavigationCommit() = 0;
- // Returns whether or not the observer is currently listening for navigation
- // commits for the given NavigationController.
- virtual bool IsListeningForNavigationCommit(
- const content::NavigationController* nav_controller) = 0;
+ // Enables or disables listening for tab destruction. OnTabClosed will be
+ // called on tab destruction if listening is enabled.
+ virtual void SetListeningForTabDestruction(bool listen) = 0;
- // Enables or disables listening for tab destruction for the given
- // NavigationController. OnTabClosed will be called on tab destruction if
- // listening is enabled.
- virtual void SetListeningForTabDestruction(
- const content::NavigationController* nav_controller,
- bool listen) = 0;
-
- // Returns whether or not the observer is currently listening for tab
- // destruction for the given NavigationController.
- virtual bool IsListeningForTabDestruction(
- const content::NavigationController* nav_controller) = 0;
+ // Returns whether or not this object is currently listening for tab
+ // destruction.
+ virtual bool IsListeningForTabDestruction() = 0;
+
+ protected:
+ GoogleURLTracker* google_url_tracker() { return google_url_tracker_; }
+
+ private:
+ GoogleURLTracker* google_url_tracker_;
+
+ DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerNavigationHelper);
};
#endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698