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