[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / google / google_url_tracker_navigation_helper.h
blob26b7a5348762a03183fa1147e7fcec73aa292250
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
8 class GoogleURLTracker;
9 class InfoBarService;
10 class Profile;
12 namespace content {
13 class NavigationController;
16 // A helper class for GoogleURLTracker that abstracts the details of listening
17 // for various navigation events.
18 class GoogleURLTrackerNavigationHelper {
19 public:
20 virtual ~GoogleURLTrackerNavigationHelper() {}
22 // Sets the GoogleURLTracker that is associated with this object.
23 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) = 0;
25 // Enables or disables listening for navigation commits for the given
26 // NavigationController. OnNavigationCommitted will be called for each
27 // navigation commit if listening is enabled.
28 virtual void SetListeningForNavigationCommit(
29 const content::NavigationController* nav_controller,
30 bool listen) = 0;
32 // Returns whether or not the observer is currently listening for navigation
33 // commits for the given NavigationController.
34 virtual bool IsListeningForNavigationCommit(
35 const content::NavigationController* nav_controller) = 0;
37 // Enables or disables listening for tab destruction for the given
38 // NavigationController. OnTabClosed will be called on tab destruction if
39 // listening is enabled.
40 virtual void SetListeningForTabDestruction(
41 const content::NavigationController* nav_controller,
42 bool listen) = 0;
44 // Returns whether or not the observer is currently listening for tab
45 // destruction for the given NavigationController.
46 virtual bool IsListeningForTabDestruction(
47 const content::NavigationController* nav_controller) = 0;
50 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_