Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "ipc/ipc_listener.h" | 14 #include "ipc/ipc_listener.h" |
| 15 #include "ipc/ipc_sender.h" | 15 #include "ipc/ipc_sender.h" |
| 16 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 16 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
| 17 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
| 18 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 18 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
| 19 #include "v8/include/v8.h" | 19 #include "v8/include/v8.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 class WebFormElement; | 22 class WebFormElement; |
| 23 class WebFrame; | 23 class WebLocalFrame; |
| 24 class WebNode; | 24 class WebNode; |
| 25 class WebString; | 25 class WebString; |
| 26 struct WebURLError; | 26 struct WebURLError; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 class RendererPpapiHost; | 31 class RendererPpapiHost; |
| 32 class RenderFrame; | 32 class RenderFrame; |
| 33 class RenderFrameImpl; | 33 class RenderFrameImpl; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 51 // Called when the RenderFrame visiblity is changed. | 51 // Called when the RenderFrame visiblity is changed. |
| 52 virtual void WasHidden() {} | 52 virtual void WasHidden() {} |
| 53 virtual void WasShown() {} | 53 virtual void WasShown() {} |
| 54 | 54 |
| 55 // Called when associated widget is about to close. | 55 // Called when associated widget is about to close. |
| 56 virtual void WidgetWillClose() {} | 56 virtual void WidgetWillClose() {} |
| 57 | 57 |
| 58 // These match the Blink API notifications | 58 // These match the Blink API notifications |
| 59 virtual void DidCreateNewDocument() {} | 59 virtual void DidCreateNewDocument() {} |
| 60 virtual void DidCreateDocumentElement() {} | 60 virtual void DidCreateDocumentElement() {} |
| 61 // Called when a provisional load is about to commit in a frame. This is | |
| 62 // dispatched just before the Javascript unload event. | |
| 63 virtual void WillCommitProvisionalLoad() {} | |
|
dcheng
2016/09/30 06:20:42
Looking at how this is used, I think these could a
| |
| 61 virtual void DidCommitProvisionalLoad(bool is_new_navigation, | 64 virtual void DidCommitProvisionalLoad(bool is_new_navigation, |
| 62 bool is_same_page_navigation) {} | 65 bool is_same_page_navigation) {} |
| 63 virtual void DidStartProvisionalLoad() {} | 66 virtual void DidStartProvisionalLoad() {} |
| 64 virtual void DidFailProvisionalLoad(const blink::WebURLError& error) {} | 67 virtual void DidFailProvisionalLoad(const blink::WebURLError& error) {} |
| 65 virtual void DidFinishLoad() {} | 68 virtual void DidFinishLoad() {} |
| 66 virtual void DidFinishDocumentLoad() {} | 69 virtual void DidFinishDocumentLoad() {} |
| 67 virtual void DidCreateScriptContext(v8::Local<v8::Context> context, | 70 virtual void DidCreateScriptContext(v8::Local<v8::Context> context, |
| 68 int extension_group, | 71 int extension_group, |
| 69 int world_id) {} | 72 int world_id) {} |
| 70 virtual void WillReleaseScriptContext(v8::Local<v8::Context> context, | 73 virtual void WillReleaseScriptContext(v8::Local<v8::Context> context, |
| 71 int world_id) {} | 74 int world_id) {} |
| 72 virtual void DidClearWindowObject() {} | 75 virtual void DidClearWindowObject() {} |
| 73 virtual void DidChangeManifest() {} | 76 virtual void DidChangeManifest() {} |
| 74 virtual void DidChangeScrollOffset() {} | 77 virtual void DidChangeScrollOffset() {} |
| 75 virtual void WillSendSubmitEvent(const blink::WebFormElement& form) {} | 78 virtual void WillSendSubmitEvent(const blink::WebFormElement& form) {} |
| 76 virtual void WillSubmitForm(const blink::WebFormElement& form) {} | 79 virtual void WillSubmitForm(const blink::WebFormElement& form) {} |
| 77 virtual void DidMatchCSS( | 80 virtual void DidMatchCSS( |
| 78 const blink::WebVector<blink::WebString>& newly_matching_selectors, | 81 const blink::WebVector<blink::WebString>& newly_matching_selectors, |
| 79 const blink::WebVector<blink::WebString>& stopped_matching_selectors) {} | 82 const blink::WebVector<blink::WebString>& stopped_matching_selectors) {} |
| 80 | 83 |
| 81 // Called before FrameWillClose, when this frame has been detached from the | 84 // Called when this frame has been detached from the view. This *will* be |
| 82 // view, but has not been closed yet. This *will* be called when parent frames | 85 // called for child frames when a parent frame is detached. Since the frame is |
| 83 // are closing. Since the frame is already detached from the DOM at this time | 86 // already detached from the DOM at this time, it should not be inspected. |
| 84 // it should not be inspected. | |
| 85 virtual void FrameDetached() {} | 87 virtual void FrameDetached() {} |
| 86 | 88 |
| 87 // Called when the frame will soon be closed. This is the last opportunity to | |
| 88 // send messages to the host (e.g., for clean-up, shutdown, etc.). This is | |
| 89 // *not* called on child frames when parent frames are being closed. | |
| 90 virtual void FrameWillClose() {} | |
| 91 | |
| 92 // Called when we receive a console message from Blink for which we requested | 89 // Called when we receive a console message from Blink for which we requested |
| 93 // extra details (like the stack trace). |message| is the error message, | 90 // extra details (like the stack trace). |message| is the error message, |
| 94 // |source| is the Blink-reported source of the error (either external or | 91 // |source| is the Blink-reported source of the error (either external or |
| 95 // internal), and |stack_trace| is the stack trace of the error in a | 92 // internal), and |stack_trace| is the stack trace of the error in a |
| 96 // human-readable format (each frame is formatted as | 93 // human-readable format (each frame is formatted as |
| 97 // "\n at function_name (source:line_number:column_number)"). | 94 // "\n at function_name (source:line_number:column_number)"). |
| 98 virtual void DetailedConsoleMessageAdded(const base::string16& message, | 95 virtual void DetailedConsoleMessageAdded(const base::string16& message, |
| 99 const base::string16& source, | 96 const base::string16& source, |
| 100 const base::string16& stack_trace, | 97 const base::string16& stack_trace, |
| 101 uint32_t line_number, | 98 uint32_t line_number, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 RenderFrame* render_frame_; | 145 RenderFrame* render_frame_; |
| 149 // The routing ID of the associated RenderFrame. | 146 // The routing ID of the associated RenderFrame. |
| 150 int routing_id_; | 147 int routing_id_; |
| 151 | 148 |
| 152 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 149 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
| 153 }; | 150 }; |
| 154 | 151 |
| 155 } // namespace content | 152 } // namespace content |
| 156 | 153 |
| 157 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 154 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
| OLD | NEW |