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

Side by Side 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: nit 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
7 7
8 class GoogleURLTracker; 8 class GoogleURLTracker;
9 class InfoBarService;
10 class Profile;
11
12 namespace content {
13 class NavigationController;
14 }
15 9
16 // A helper class for GoogleURLTracker that abstracts the details of listening 10 // A helper class for GoogleURLTracker that abstracts the details of listening
17 // for various navigation events. 11 // for various navigation events.
18 class GoogleURLTrackerNavigationHelper { 12 class GoogleURLTrackerNavigationHelper {
19 public: 13 public:
14 GoogleURLTrackerNavigationHelper(GoogleURLTracker* tracker);
Peter Kasting 2014/05/15 21:29:52 Nit: Explicit
blundell 2014/05/16 11:54:18 Done.
20 virtual ~GoogleURLTrackerNavigationHelper() {} 15 virtual ~GoogleURLTrackerNavigationHelper() {}
Peter Kasting 2014/05/15 21:29:52 Nit: Put this destructor definition in the .cc fil
blundell 2014/05/16 11:54:18 Done.
21 16
22 // Sets the GoogleURLTracker that is associated with this object. 17 // Enables or disables listening for navigation commits.
23 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) = 0; 18 // OnNavigationCommitted will be called for each navigation commit if
19 // listening is enabled.
20 virtual void SetListeningForNavigationCommit(bool listen) = 0;
24 21
25 // Enables or disables listening for navigation commits for the given 22 // Returns whether or not this object is currently listening for navigation
26 // NavigationController. OnNavigationCommitted will be called for each 23 // commits.
27 // navigation commit if listening is enabled. 24 virtual bool IsListeningForNavigationCommit() = 0;
28 virtual void SetListeningForNavigationCommit(
29 const content::NavigationController* nav_controller,
30 bool listen) = 0;
31 25
32 // Returns whether or not the observer is currently listening for navigation 26 // Enables or disables listening for tab destruction. OnTabClosed will be
33 // commits for the given NavigationController. 27 // called on tab destruction if listening is enabled.
34 virtual bool IsListeningForNavigationCommit( 28 virtual void SetListeningForTabDestruction(bool listen) = 0;
35 const content::NavigationController* nav_controller) = 0;
36 29
37 // Enables or disables listening for tab destruction for the given 30 // Returns whether or not this object is currently listening for tab
38 // NavigationController. OnTabClosed will be called on tab destruction if 31 // destruction.
39 // listening is enabled. 32 virtual bool IsListeningForTabDestruction() = 0;
40 virtual void SetListeningForTabDestruction(
41 const content::NavigationController* nav_controller,
42 bool listen) = 0;
43 33
44 // Returns whether or not the observer is currently listening for tab 34 protected:
45 // destruction for the given NavigationController. 35 GoogleURLTracker* google_url_tracker() { return tracker_; }
Peter Kasting 2014/05/15 21:29:52 Nit: See comments on other CL regarding accessor/m
blundell 2014/05/16 11:54:18 Done.
46 virtual bool IsListeningForTabDestruction( 36
47 const content::NavigationController* nav_controller) = 0; 37 private:
38 GoogleURLTracker* tracker_;
48 }; 39 };
Peter Kasting 2014/05/15 21:29:52 Nit: DISALLOW_COPY_AND_ASSIGN
blundell 2014/05/16 11:54:18 Done.
49 40
50 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ 41 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698