Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: content/public/renderer/render_frame_observer.h

Issue 137463002: RenderFrame: flesh out Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: move didFinishLoad Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_RENDERER_RENDER_FRAME_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "ipc/ipc_listener.h" 11 #include "ipc/ipc_listener.h"
12 #include "ipc/ipc_sender.h" 12 #include "ipc/ipc_sender.h"
13 13
14 namespace blink { 14 namespace blink {
15 class WebDataSource;
15 class WebFrame; 16 class WebFrame;
17 class WebURLError;
16 } 18 }
17 19
18 namespace content { 20 namespace content {
19 21
20 class RendererPpapiHost; 22 class RendererPpapiHost;
21 class RenderFrame; 23 class RenderFrame;
22 class RenderFrameImpl; 24 class RenderFrameImpl;
23 25
24 // Base class for objects that want to filter incoming IPCs, and also get 26 // Base class for objects that want to filter incoming IPCs, and also get
25 // notified of changes to the frame. 27 // notified of changes to the frame.
26 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, 28 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
27 public IPC::Sender { 29 public IPC::Sender {
28 public: 30 public:
29 // By default, observers will be deleted when the RenderFrame goes away. If 31 // By default, observers will be deleted when the RenderFrame goes away. If
30 // they want to outlive it, they can override this function. 32 // they want to outlive it, they can override this function.
31 virtual void OnDestruct(); 33 virtual void OnDestruct();
32 34
33 // Called when a Pepper plugin is created. 35 // Called when a Pepper plugin is created.
34 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} 36 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {}
35 37
36 // Called when the WebFrame associated with the RenderFrame is created. 38 // Called when the WebFrame associated with the RenderFrame is created.
37 // When switches::kSitePerProcess is the default, there will be one 39 // When switches::kSitePerProcess is the default, there will be one
38 // RenderFrame per blink::WebFrame. If it's not set though, a RenderFrame can 40 // RenderFrame per blink::WebFrame. If it's not set though, a RenderFrame can
39 // be used for more than one blink::WebFrame. In that case, this can be called 41 // be used for more than one blink::WebFrame. In that case, this can be called
40 // more than once. 42 // more than once.
41 virtual void WebFrameCreated(blink::WebFrame* frame) {} 43 virtual void WebFrameCreated(blink::WebFrame* frame) {}
42 44
43 // These match the Blink API notifications 45 // These match the Blink API notifications
46 virtual void DidCreateDataSource(blink::WebFrame* frame,
47 blink::WebDataSource* datasource) { }
nasko 2014/01/13 22:55:32 nit: data_source or ds
44 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, 48 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame,
45 bool is_new_navigation) {} 49 bool is_new_navigation) {}
50 virtual void DidStartProvisionalLoad(blink::WebFrame* frame) { }
51 virtual void DidFailProvisionalLoad(blink::WebFrame* frame,
52 const blink::WebURLError& error) { }
53 virtual void DidFinishLoad(blink::WebFrame* frame) { }
46 54
47 // IPC::Listener implementation. 55 // IPC::Listener implementation.
48 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
49 57
50 // IPC::Sender implementation. 58 // IPC::Sender implementation.
51 virtual bool Send(IPC::Message* message) OVERRIDE; 59 virtual bool Send(IPC::Message* message) OVERRIDE;
52 60
53 RenderFrame* render_frame() const; 61 RenderFrame* render_frame() const;
54 int routing_id() const { return routing_id_; } 62 int routing_id() const { return routing_id_; }
55 63
(...skipping 11 matching lines...) Expand all
67 RenderFrame* render_frame_; 75 RenderFrame* render_frame_;
68 // The routing ID of the associated RenderFrame. 76 // The routing ID of the associated RenderFrame.
69 int routing_id_; 77 int routing_id_;
70 78
71 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); 79 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver);
72 }; 80 };
73 81
74 } // namespace content 82 } // namespace content
75 83
76 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ 84 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698