| OLD | NEW |
| 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; | 9 class InfoBarService; |
| 10 class Profile; | 10 class Profile; |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class NavigationController; | 13 class NavigationController; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // A helper class for GoogleURLTracker that abstracts the details of listening | 16 // A helper class for GoogleURLTracker that abstracts the details of listening |
| 17 // for various navigation events. | 17 // for various navigation events. |
| 18 class GoogleURLTrackerNavigationHelper { | 18 class GoogleURLTrackerNavigationHelper { |
| 19 public: | 19 public: |
| 20 virtual ~GoogleURLTrackerNavigationHelper() {} | 20 virtual ~GoogleURLTrackerNavigationHelper() {} |
| 21 | 21 |
| 22 // Sets the GoogleURLTracker that should receive callbacks from this observer. | 22 // Sets the GoogleURLTracker that is associated with this object. |
| 23 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) = 0; | 23 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) = 0; |
| 24 | 24 |
| 25 // Enables or disables listening for navigation starts. OnNavigationPending | |
| 26 // will be called for each navigation start if listening is enabled. | |
| 27 virtual void SetListeningForNavigationStart(bool listen) = 0; | |
| 28 | |
| 29 // Returns whether or not the observer is currently listening for navigation | |
| 30 // starts. | |
| 31 virtual bool IsListeningForNavigationStart() = 0; | |
| 32 | |
| 33 // Enables or disables listening for navigation commits for the given | 25 // Enables or disables listening for navigation commits for the given |
| 34 // NavigationController. OnNavigationCommitted will be called for each | 26 // NavigationController. OnNavigationCommitted will be called for each |
| 35 // navigation commit if listening is enabled. | 27 // navigation commit if listening is enabled. |
| 36 virtual void SetListeningForNavigationCommit( | 28 virtual void SetListeningForNavigationCommit( |
| 37 const content::NavigationController* nav_controller, | 29 const content::NavigationController* nav_controller, |
| 38 bool listen) = 0; | 30 bool listen) = 0; |
| 39 | 31 |
| 40 // Returns whether or not the observer is currently listening for navigation | 32 // Returns whether or not the observer is currently listening for navigation |
| 41 // commits for the given NavigationController. | 33 // commits for the given NavigationController. |
| 42 virtual bool IsListeningForNavigationCommit( | 34 virtual bool IsListeningForNavigationCommit( |
| 43 const content::NavigationController* nav_controller) = 0; | 35 const content::NavigationController* nav_controller) = 0; |
| 44 | 36 |
| 45 // Enables or disables listening for tab destruction for the given | 37 // Enables or disables listening for tab destruction for the given |
| 46 // NavigationController. OnTabClosed will be called on tab destruction if | 38 // NavigationController. OnTabClosed will be called on tab destruction if |
| 47 // listening is enabled. | 39 // listening is enabled. |
| 48 virtual void SetListeningForTabDestruction( | 40 virtual void SetListeningForTabDestruction( |
| 49 const content::NavigationController* nav_controller, | 41 const content::NavigationController* nav_controller, |
| 50 bool listen) = 0; | 42 bool listen) = 0; |
| 51 | 43 |
| 52 // Returns whether or not the observer is currently listening for tab | 44 // Returns whether or not the observer is currently listening for tab |
| 53 // destruction for the given NavigationController. | 45 // destruction for the given NavigationController. |
| 54 virtual bool IsListeningForTabDestruction( | 46 virtual bool IsListeningForTabDestruction( |
| 55 const content::NavigationController* nav_controller) = 0; | 47 const content::NavigationController* nav_controller) = 0; |
| 56 }; | 48 }; |
| 57 | 49 |
| 58 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ | 50 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ |
| OLD | NEW |