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/process_util.h" | 8 #include "base/process_util.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
11 #include "content/public/common/page_transition_types.h" | 11 #include "content/public/common/page_transition_types.h" |
12 #include "content/public/common/three_d_api_types.h" | 12 #include "content/public/common/three_d_api_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 namespace content { | 17 namespace content { |
18 | 18 |
19 class RenderViewHost; | 19 class RenderViewHost; |
20 class WebContents; | 20 class WebContents; |
21 class WebContentsImpl; | 21 class WebContentsImpl; |
| 22 struct FaviconURL; |
22 struct FrameNavigateParams; | 23 struct FrameNavigateParams; |
23 struct LoadCommittedDetails; | 24 struct LoadCommittedDetails; |
24 struct Referrer; | 25 struct Referrer; |
25 | 26 |
26 // An observer API implemented by classes which are interested in various page | 27 // An observer API implemented by classes which are interested in various page |
27 // load events from WebContents. They also get a chance to filter IPC messages. | 28 // load events from WebContents. They also get a chance to filter IPC messages. |
28 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, | 29 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, |
29 public IPC::Sender { | 30 public IPC::Sender { |
30 public: | 31 public: |
31 // Only one of the two methods below will be called when a RVH is created for | 32 // Only one of the two methods below will be called when a RVH is created for |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 // Called when the user agent override for a WebContents has been changed. | 137 // Called when the user agent override for a WebContents has been changed. |
137 virtual void UserAgentOverrideSet(const std::string& user_agent) {} | 138 virtual void UserAgentOverrideSet(const std::string& user_agent) {} |
138 | 139 |
139 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just | 140 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just |
140 // blocked on the current page, specifically because the GPU was | 141 // blocked on the current page, specifically because the GPU was |
141 // reset recently. | 142 // reset recently. |
142 virtual void DidBlock3DAPIs(const GURL& url, | 143 virtual void DidBlock3DAPIs(const GURL& url, |
143 ThreeDAPIType requester) {} | 144 ThreeDAPIType requester) {} |
144 | 145 |
| 146 // Invoked when new FaviconURL candidates are received from the renderer. |
| 147 virtual void DidUpdateFaviconURL(int32 page_id, |
| 148 const std::vector<FaviconURL>& candidates) {} |
| 149 |
145 // IPC::Listener implementation. | 150 // IPC::Listener implementation. |
146 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 151 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
147 | 152 |
148 // IPC::Sender implementation. | 153 // IPC::Sender implementation. |
149 virtual bool Send(IPC::Message* message) OVERRIDE; | 154 virtual bool Send(IPC::Message* message) OVERRIDE; |
150 int routing_id() const; | 155 int routing_id() const; |
151 | 156 |
152 protected: | 157 protected: |
153 // Use this constructor when the object is tied to a single WebContents for | 158 // Use this constructor when the object is tied to a single WebContents for |
154 // its entire lifetime. | 159 // its entire lifetime. |
(...skipping 19 matching lines...) Expand all Loading... |
174 void WebContentsImplDestroyed(); | 179 void WebContentsImplDestroyed(); |
175 | 180 |
176 WebContentsImpl* web_contents_; | 181 WebContentsImpl* web_contents_; |
177 | 182 |
178 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 183 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
179 }; | 184 }; |
180 | 185 |
181 } // namespace content | 186 } // namespace content |
182 | 187 |
183 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 188 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |