| 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 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/navigation_controller.h" | 11 #include "content/public/browser/navigation_controller.h" |
| 12 #include "content/public/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
| 13 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
| 14 #include "ipc/ipc_sender.h" | 14 #include "ipc/ipc_sender.h" |
| 15 #include "webkit/glue/window_open_disposition.h" | 15 #include "webkit/glue/window_open_disposition.h" |
| 16 | 16 |
| 17 class WebContentsImpl; | |
| 18 | |
| 19 namespace content { | 17 namespace content { |
| 20 | 18 |
| 21 class RenderViewHost; | 19 class RenderViewHost; |
| 22 class WebContents; | 20 class WebContents; |
| 21 class WebContentsImpl; |
| 23 struct FrameNavigateParams; | 22 struct FrameNavigateParams; |
| 24 struct LoadCommittedDetails; | 23 struct LoadCommittedDetails; |
| 25 struct Referrer; | 24 struct Referrer; |
| 26 | 25 |
| 27 // An observer API implemented by classes which are interested in various page | 26 // An observer API implemented by classes which are interested in various page |
| 28 // load events from WebContents. They also get a chance to filter IPC messages. | 27 // load events from WebContents. They also get a chance to filter IPC messages. |
| 29 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, | 28 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, |
| 30 public IPC::Sender { | 29 public IPC::Sender { |
| 31 public: | 30 public: |
| 32 // Only one of the two methods below will be called when a RVH is created for | 31 // Only one of the two methods below will be called when a RVH is created for |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 WebContentsObserver(); | 167 WebContentsObserver(); |
| 169 | 168 |
| 170 virtual ~WebContentsObserver(); | 169 virtual ~WebContentsObserver(); |
| 171 | 170 |
| 172 // Start observing a different WebContents; used with the default constructor. | 171 // Start observing a different WebContents; used with the default constructor. |
| 173 void Observe(WebContents* web_contents); | 172 void Observe(WebContents* web_contents); |
| 174 | 173 |
| 175 WebContents* web_contents() const; | 174 WebContents* web_contents() const; |
| 176 | 175 |
| 177 private: | 176 private: |
| 178 friend class ::WebContentsImpl; | 177 friend class WebContentsImpl; |
| 179 | 178 |
| 180 // Invoked from WebContentsImpl. Invokes WebContentsDestroyed and NULL out | 179 // Invoked from WebContentsImpl. Invokes WebContentsDestroyed and NULL out |
| 181 // |web_contents_|. | 180 // |web_contents_|. |
| 182 void WebContentsImplDestroyed(); | 181 void WebContentsImplDestroyed(); |
| 183 | 182 |
| 184 WebContentsImpl* web_contents_; | 183 WebContentsImpl* web_contents_; |
| 185 | 184 |
| 186 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 185 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 187 }; | 186 }; |
| 188 | 187 |
| 189 } // namespace content | 188 } // namespace content |
| 190 | 189 |
| 191 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 190 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |