OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ | 5 #ifndef COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ |
6 #define COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ | 6 #define COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 class GoogleURLTracker; | 11 class GoogleURLTracker; |
12 class PrefService; | 12 class PrefService; |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
16 } | 16 } |
17 | 17 |
18 // Interface by which GoogleURLTracker communicates with its embedder. | 18 // Interface by which GoogleURLTracker communicates with its embedder. |
19 class GoogleURLTrackerClient { | 19 class GoogleURLTrackerClient { |
20 public: | 20 public: |
21 GoogleURLTrackerClient(); | 21 GoogleURLTrackerClient(); |
22 virtual ~GoogleURLTrackerClient(); | 22 virtual ~GoogleURLTrackerClient(); |
23 | 23 |
24 // Sets the GoogleURLTracker that is associated with this client. | 24 // Sets the GoogleURLTracker that is associated with this client. |
25 void set_google_url_tracker(GoogleURLTracker* google_url_tracker) { | 25 void set_google_url_tracker(GoogleURLTracker* google_url_tracker) { |
26 google_url_tracker_ = google_url_tracker; | 26 google_url_tracker_ = google_url_tracker; |
27 } | 27 } |
28 | 28 |
29 // Enables or disables listening for navigation starts. OnNavigationPending | |
30 // will be called for each navigation start if listening is enabled. | |
31 virtual void SetListeningForNavigationStart(bool listen) = 0; | |
32 | |
33 // Returns whether or not the client is currently listening for navigation | |
34 // starts. | |
35 virtual bool IsListeningForNavigationStart() = 0; | |
36 | |
37 // Returns whether background networking is enabled. | 29 // Returns whether background networking is enabled. |
38 virtual bool IsBackgroundNetworkingEnabled() = 0; | 30 virtual bool IsBackgroundNetworkingEnabled() = 0; |
39 | 31 |
40 // Returns the PrefService that the GoogleURLTracker should use. | 32 // Returns the PrefService that the GoogleURLTracker should use. |
41 virtual PrefService* GetPrefs() = 0; | 33 virtual PrefService* GetPrefs() = 0; |
42 | 34 |
43 // Returns the URL request context information that the GoogleURLTracker | 35 // Returns the URL request context information that the GoogleURLTracker |
44 // should use. | 36 // should use. |
45 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 37 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
46 | 38 |
47 protected: | 39 protected: |
48 GoogleURLTracker* google_url_tracker() { return google_url_tracker_; } | 40 GoogleURLTracker* google_url_tracker() { return google_url_tracker_; } |
49 | 41 |
50 private: | 42 private: |
51 GoogleURLTracker* google_url_tracker_; | 43 GoogleURLTracker* google_url_tracker_; |
52 | 44 |
53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerClient); | 45 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerClient); |
54 }; | 46 }; |
55 | 47 |
56 #endif // COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ | 48 #endif // COMPONENTS_GOOGLE_GOOGLE_URL_TRACKER_CLIENT_H_ |
OLD | NEW |