| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "content/browser/tab_contents/navigation_controller.h" | 8 #include "content/browser/tab_contents/navigation_controller.h" |
| 9 #include "content/common/page_transition_types.h" | 9 #include "content/common/page_transition_types.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| 11 #include "webkit/glue/window_open_disposition.h" | 11 #include "webkit/glue/window_open_disposition.h" |
| 12 | 12 |
| 13 struct ViewHostMsg_FrameNavigate_Params; | 13 struct ViewHostMsg_FrameNavigate_Params; |
| 14 | 14 |
| 15 // An observer API implemented by classes which are interested in various page | 15 // An observer API implemented by classes which are interested in various page |
| 16 // load events from TabContents. They also get a chance to filter IPC messages. | 16 // load events from TabContents. They also get a chance to filter IPC messages. |
| 17 class TabContentsObserver : public IPC::Channel::Listener, | 17 class TabContentsObserver : public IPC::Channel::Listener, |
| 18 public IPC::Message::Sender { | 18 public IPC::Message::Sender { |
| 19 public: | 19 public: |
| 20 // Use this as a member variable in a class that uses the emptry constructor | 20 // Use this as a member variable in a class that uses the empty constructor |
| 21 // version of this interface. | 21 // version of this interface. |
| 22 class Registrar { | 22 class Registrar { |
| 23 public: | 23 public: |
| 24 explicit Registrar(TabContentsObserver* observer); | 24 explicit Registrar(TabContentsObserver* observer); |
| 25 ~Registrar(); | 25 ~Registrar(); |
| 26 | 26 |
| 27 // Call this to start observing a tab. Passing in NULL resets it. | 27 // Call this to start observing a tab. Passing in NULL resets it. |
| 28 // This can only be used to watch one tab at a time. If you call this and | 28 // This can only be used to watch one tab at a time. If you call this and |
| 29 // you're already observing another tab, the old tab won't be observed | 29 // you're already observing another tab, the old tab won't be observed |
| 30 // afterwards. | 30 // afterwards. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 TabContents* tab_contents_; | 128 TabContents* tab_contents_; |
| 129 | 129 |
| 130 // The routing ID of the associated TabContents. | 130 // The routing ID of the associated TabContents. |
| 131 int routing_id_; | 131 int routing_id_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); | 133 DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ | 136 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |