| 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_AUTOCOMPLETE_EDIT_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_AUTOCOMPLETE_EDIT_TRACKER_H_ |
| 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_AUTOCOMPLETE_EDIT_TRACKER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_AUTOCOMPLETE_EDIT_TRACKER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| 10 #include "chrome/browser/automation/automation_resource_tracker.h" | 10 #include "chrome/browser/automation/automation_resource_tracker.h" |
| 11 #include "chrome/common/notification_source.h" | |
| 12 #include "chrome/common/notification_type.h" | |
| 13 | 11 |
| 14 class AutomationAutocompleteEditTracker | 12 class AutomationAutocompleteEditTracker |
| 15 : public AutomationResourceTracker<AutocompleteEditView*> { | 13 : public AutomationResourceTracker<AutocompleteEditView*> { |
| 16 public: | 14 public: |
| 17 explicit AutomationAutocompleteEditTracker(IPC::Message::Sender* automation) | 15 explicit AutomationAutocompleteEditTracker(IPC::Message::Sender* automation); |
| 18 : AutomationResourceTracker<AutocompleteEditView*>(automation) { } | 16 virtual ~AutomationAutocompleteEditTracker(); |
| 19 | 17 virtual void AddObserver(AutocompleteEditView* resource); |
| 20 virtual ~AutomationAutocompleteEditTracker() { | 18 virtual void RemoveObserver(AutocompleteEditView* resource); |
| 21 } | |
| 22 | |
| 23 virtual void AddObserver(AutocompleteEditView* resource) { | |
| 24 registrar_.Add(this, NotificationType::AUTOCOMPLETE_EDIT_DESTROYED, | |
| 25 Source<AutocompleteEditView>(resource)); | |
| 26 } | |
| 27 | |
| 28 virtual void RemoveObserver(AutocompleteEditView* resource) { | |
| 29 registrar_.Remove(this, NotificationType::AUTOCOMPLETE_EDIT_DESTROYED, | |
| 30 Source<AutocompleteEditView>(resource)); | |
| 31 } | |
| 32 }; | 19 }; |
| 33 | 20 |
| 34 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_AUTOCOMPLETE_EDIT_TRACKER_H_ | 21 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_AUTOCOMPLETE_EDIT_TRACKER_H_ |
| OLD | NEW |