OLD | NEW |
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 #include "chrome/browser/automation/automation_tab_tracker.h" | 5 #include "chrome/browser/automation/automation_tab_tracker.h" |
6 | 6 |
| 7 #include "base/logging.h" |
7 #include "chrome/common/chrome_notification_types.h" | 8 #include "chrome/common/chrome_notification_types.h" |
8 #include "content/public/browser/navigation_controller.h" | 9 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
10 | 11 |
11 using content::NavigationController; | 12 using content::NavigationController; |
12 | 13 |
13 AutomationTabTracker::AutomationTabTracker(IPC::Message::Sender* automation) | 14 AutomationTabTracker::AutomationTabTracker(IPC::Sender* automation) |
14 : AutomationResourceTracker<NavigationController*>(automation) { | 15 : AutomationResourceTracker<NavigationController*>(automation) { |
15 } | 16 } |
16 | 17 |
17 AutomationTabTracker::~AutomationTabTracker() { | 18 AutomationTabTracker::~AutomationTabTracker() { |
18 } | 19 } |
19 | 20 |
20 void AutomationTabTracker::AddObserver(NavigationController* resource) { | 21 void AutomationTabTracker::AddObserver(NavigationController* resource) { |
21 // This tab could either be a regular tab or an external tab | 22 // This tab could either be a regular tab or an external tab |
22 // Register for both notifications. | 23 // Register for both notifications. |
23 registrar_.Add(this, chrome::NOTIFICATION_TAB_CLOSING, | 24 registrar_.Add(this, chrome::NOTIFICATION_TAB_CLOSING, |
(...skipping 16 matching lines...) Expand all Loading... |
40 switch (type) { | 41 switch (type) { |
41 case chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED: | 42 case chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED: |
42 case chrome::NOTIFICATION_TAB_CLOSING: | 43 case chrome::NOTIFICATION_TAB_CLOSING: |
43 break; | 44 break; |
44 default: | 45 default: |
45 NOTREACHED(); | 46 NOTREACHED(); |
46 } | 47 } |
47 AutomationResourceTracker<NavigationController*>::Observe( | 48 AutomationResourceTracker<NavigationController*>::Observe( |
48 type, source, details); | 49 type, source, details); |
49 } | 50 } |
OLD | NEW |