OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ |
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "chrome/browser/automation/automation_resource_tracker.h" | 12 #include "chrome/browser/automation/automation_resource_tracker.h" |
13 | 13 |
14 class NavigationController; | 14 class NavigationController; |
15 class NotificationType; | |
16 | 15 |
17 class AutomationTabTracker | 16 class AutomationTabTracker |
18 : public AutomationResourceTracker<NavigationController*> { | 17 : public AutomationResourceTracker<NavigationController*> { |
19 public: | 18 public: |
20 explicit AutomationTabTracker(IPC::Message::Sender* automation); | 19 explicit AutomationTabTracker(IPC::Message::Sender* automation); |
21 virtual ~AutomationTabTracker(); | 20 virtual ~AutomationTabTracker(); |
22 | 21 |
23 virtual void AddObserver(NavigationController* resource); | 22 virtual void AddObserver(NavigationController* resource); |
24 virtual void RemoveObserver(NavigationController* resource); | 23 virtual void RemoveObserver(NavigationController* resource); |
25 | 24 |
26 virtual void Observe(NotificationType type, | 25 virtual void Observe(int type, |
27 const NotificationSource& source, | 26 const NotificationSource& source, |
28 const NotificationDetails& details); | 27 const NotificationDetails& details); |
29 | 28 |
30 base::Time GetLastNavigationTime(int handle); | 29 base::Time GetLastNavigationTime(int handle); |
31 | 30 |
32 private: | 31 private: |
33 // Last time a navigation occurred. | 32 // Last time a navigation occurred. |
34 std::map<NavigationController*, base::Time> last_navigation_times_; | 33 std::map<NavigationController*, base::Time> last_navigation_times_; |
35 | 34 |
36 DISALLOW_COPY_AND_ASSIGN(AutomationTabTracker); | 35 DISALLOW_COPY_AND_ASSIGN(AutomationTabTracker); |
37 }; | 36 }; |
38 | 37 |
39 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ | 38 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_TAB_TRACKER_H_ |
OLD | NEW |