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

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

Issue 283413002: Turn GoogleURLTrackerNavigationHelper(Impl) into a per-tab object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review 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_MAP_ENTRY_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_
7 7
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/google/google_url_tracker_navigation_helper.h"
8 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
9 #include "content/public/browser/notification_registrar.h" 11 #include "content/public/browser/notification_registrar.h"
10 12
11 class GoogleURLTracker; 13 class GoogleURLTracker;
12 class GoogleURLTrackerInfoBarDelegate; 14 class GoogleURLTrackerInfoBarDelegate;
13 class InfoBarService; 15 class InfoBarService;
14 16
15 namespace content {
16 class NavigationController;
17 }
18
19 class GoogleURLTrackerMapEntry : public content::NotificationObserver { 17 class GoogleURLTrackerMapEntry : public content::NotificationObserver {
20 public: 18 public:
21 GoogleURLTrackerMapEntry( 19 GoogleURLTrackerMapEntry(
22 GoogleURLTracker* google_url_tracker, 20 GoogleURLTracker* google_url_tracker,
23 InfoBarService* infobar_service, 21 InfoBarService* infobar_service,
24 const content::NavigationController* navigation_controller); 22 scoped_ptr<GoogleURLTrackerNavigationHelper> navigation_helper);
25 virtual ~GoogleURLTrackerMapEntry(); 23 virtual ~GoogleURLTrackerMapEntry();
26 24
27 bool has_infobar_delegate() const { return !!infobar_delegate_; } 25 bool has_infobar_delegate() const { return !!infobar_delegate_; }
28 GoogleURLTrackerInfoBarDelegate* infobar_delegate() { 26 GoogleURLTrackerInfoBarDelegate* infobar_delegate() {
29 return infobar_delegate_; 27 return infobar_delegate_;
30 } 28 }
31 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate); 29 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate);
32 30
33 const content::NavigationController* navigation_controller() const { 31 GoogleURLTrackerNavigationHelper* navigation_helper() {
34 return navigation_controller_; 32 return navigation_helper_.get();
35 } 33 }
36 34
37 void Close(bool redo_search); 35 void Close(bool redo_search);
38 36
39 private: 37 private:
40 friend class GoogleURLTrackerTest; 38 friend class GoogleURLTrackerTest;
41 39
42 // content::NotificationObserver: 40 // content::NotificationObserver:
43 virtual void Observe(int type, 41 virtual void Observe(int type,
44 const content::NotificationSource& source, 42 const content::NotificationSource& source,
45 const content::NotificationDetails& details) OVERRIDE; 43 const content::NotificationDetails& details) OVERRIDE;
46 44
47 content::NotificationRegistrar registrar_; 45 content::NotificationRegistrar registrar_;
48 GoogleURLTracker* const google_url_tracker_; 46 GoogleURLTracker* const google_url_tracker_;
49 const InfoBarService* const infobar_service_; 47 const InfoBarService* const infobar_service_;
50 GoogleURLTrackerInfoBarDelegate* infobar_delegate_; 48 GoogleURLTrackerInfoBarDelegate* infobar_delegate_;
51 const content::NavigationController* const navigation_controller_; 49 scoped_ptr<GoogleURLTrackerNavigationHelper> navigation_helper_;
52 50
53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); 51 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry);
54 }; 52 };
55 53
56 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ 54 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698