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

Side by Side Diff: chrome/browser/google/google_url_tracker_navigation_helper.h

Issue 293503003: Eliminate dependence of GoogleURLTracker et al. on InfoBarService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 6 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 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/base/window_open_disposition.h"
9 10
10 class GoogleURLTracker; 11 class GoogleURLTracker;
12 class GURL;
11 13
12 // A helper class for GoogleURLTracker that abstracts the details of listening 14 // Interface via which GoogleURLTracker communicates with its driver.
13 // for various navigation events. 15 // TODO(blundell): Rename this class to GoogleURLTrackerDriver.
16 // crbug.com/373221
14 class GoogleURLTrackerNavigationHelper { 17 class GoogleURLTrackerNavigationHelper {
15 public: 18 public:
16 explicit GoogleURLTrackerNavigationHelper( 19 explicit GoogleURLTrackerNavigationHelper(
17 GoogleURLTracker* google_url_tracker); 20 GoogleURLTracker* google_url_tracker);
18 virtual ~GoogleURLTrackerNavigationHelper(); 21 virtual ~GoogleURLTrackerNavigationHelper();
19 22
20 // Enables or disables listening for navigation commits. 23 // Enables or disables listening for navigation commits.
21 // OnNavigationCommitted will be called for each navigation commit if 24 // OnNavigationCommitted will be called for each navigation commit if
22 // listening is enabled. 25 // listening is enabled.
23 virtual void SetListeningForNavigationCommit(bool listen) = 0; 26 virtual void SetListeningForNavigationCommit(bool listen) = 0;
24 27
25 // Returns whether or not this object is currently listening for navigation 28 // Returns whether or not this object is currently listening for navigation
26 // commits. 29 // commits.
27 virtual bool IsListeningForNavigationCommit() = 0; 30 virtual bool IsListeningForNavigationCommit() = 0;
28 31
29 // Enables or disables listening for tab destruction. OnTabClosed will be 32 // Enables or disables listening for tab destruction. OnTabClosed will be
30 // called on tab destruction if listening is enabled. 33 // called on tab destruction if listening is enabled.
31 virtual void SetListeningForTabDestruction(bool listen) = 0; 34 virtual void SetListeningForTabDestruction(bool listen) = 0;
32 35
33 // Returns whether or not this object is currently listening for tab 36 // Returns whether or not this object is currently listening for tab
34 // destruction. 37 // destruction.
35 virtual bool IsListeningForTabDestruction() = 0; 38 virtual bool IsListeningForTabDestruction() = 0;
36 39
40 // Opens |url| with the given window disposition.
41 virtual void OpenURL(GURL url,
42 WindowOpenDisposition disposition,
43 bool user_clicked_on_link) = 0;
44
37 protected: 45 protected:
38 GoogleURLTracker* google_url_tracker() { return google_url_tracker_; } 46 GoogleURLTracker* google_url_tracker() { return google_url_tracker_; }
39 47
40 private: 48 private:
41 GoogleURLTracker* google_url_tracker_; 49 GoogleURLTracker* google_url_tracker_;
42 50
43 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerNavigationHelper); 51 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerNavigationHelper);
44 }; 52 };
45 53
46 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_ 54 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698