| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebLocalFrame_h | 5 #ifndef WebLocalFrame_h |
| 6 #define WebLocalFrame_h | 6 #define WebLocalFrame_h |
| 7 | 7 |
| 8 #include "WebFrame.h" | 8 #include "WebFrame.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebScriptExecutionCallback; |
| 13 |
| 12 // Interface for interacting with in process frames. This contains methods that | 14 // Interface for interacting with in process frames. This contains methods that |
| 13 // require interacting with a frame's document. | 15 // require interacting with a frame's document. |
| 14 // FIXME: Move lots of methods from WebFrame in here. | 16 // FIXME: Move lots of methods from WebFrame in here. |
| 15 class WebLocalFrame : public WebFrame { | 17 class WebLocalFrame : public WebFrame { |
| 16 public: | 18 public: |
| 17 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). | 19 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). |
| 18 // It is valid to pass a null client pointer. | 20 // It is valid to pass a null client pointer. |
| 19 BLINK_EXPORT static WebLocalFrame* create(WebFrameClient*); | 21 BLINK_EXPORT static WebLocalFrame* create(WebFrameClient*); |
| 20 | 22 |
| 21 // Returns the WebFrame associated with the current V8 context. This | 23 // Returns the WebFrame associated with the current V8 context. This |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual void navigateToSandboxedMarkup(const WebData& markup) = 0; | 62 virtual void navigateToSandboxedMarkup(const WebData& markup) = 0; |
| 61 | 63 |
| 62 | 64 |
| 63 // Orientation Changes ---------------------------------------------------- | 65 // Orientation Changes ---------------------------------------------------- |
| 64 | 66 |
| 65 // Notify the frame that the screen orientation has changed. | 67 // Notify the frame that the screen orientation has changed. |
| 66 virtual void sendOrientationChangeEvent() = 0; | 68 virtual void sendOrientationChangeEvent() = 0; |
| 67 | 69 |
| 68 | 70 |
| 69 // Scripting -------------------------------------------------------------- | 71 // Scripting -------------------------------------------------------------- |
| 72 // Executes script in the context of the current page and returns the value |
| 73 // that the script evaluated to with callback. Script execution can be |
| 74 // suspend. |
| 75 virtual void requestExecuteScriptAndReturnValue(const WebScriptSource&, |
| 76 bool userGesture, WebScriptExecutionCallback*) = 0; |
| 77 |
| 78 // worldID must be > 0 (as 0 represents the main world). |
| 79 // worldID must be < EmbedderWorldIdLimit, high number used internally. |
| 80 virtual void requestExecuteScriptInIsolatedWorld( |
| 81 int worldID, const WebScriptSource* sourceIn, unsigned numSources, |
| 82 int extensionGroup, bool userGesture, WebScriptExecutionCallback*) = 0; |
| 83 |
| 70 // ONLY FOR TESTS: Forwards to executeScriptAndReturnValue, but sets a fake | 84 // ONLY FOR TESTS: Forwards to executeScriptAndReturnValue, but sets a fake |
| 71 // UserGestureIndicator before execution. | 85 // UserGestureIndicator before execution. |
| 72 virtual v8::Handle<v8::Value> executeScriptAndReturnValueForTests(const WebS
criptSource&) = 0; | 86 virtual v8::Handle<v8::Value> executeScriptAndReturnValueForTests(const WebS
criptSource&) = 0; |
| 73 | 87 |
| 74 // Associates an isolated world with human-readable name which is useful for | 88 // Associates an isolated world with human-readable name which is useful for |
| 75 // extension debugging. | 89 // extension debugging. |
| 76 virtual void setIsolatedWorldHumanReadableName(int worldID, const WebString&
) = 0; | 90 virtual void setIsolatedWorldHumanReadableName(int worldID, const WebString&
) = 0; |
| 77 | 91 |
| 78 | 92 |
| 79 // Selection -------------------------------------------------------------- | 93 // Selection -------------------------------------------------------------- |
| 80 | 94 |
| 81 // Moves the selection extent point. This function does not allow the | 95 // Moves the selection extent point. This function does not allow the |
| 82 // selection to collapse. If the new extent is set to the same position as | 96 // selection to collapse. If the new extent is set to the same position as |
| 83 // the current base, this function will do nothing. | 97 // the current base, this function will do nothing. |
| 84 virtual void moveRangeSelectionExtent(const WebPoint&) = 0; | 98 virtual void moveRangeSelectionExtent(const WebPoint&) = 0; |
| 85 }; | 99 }; |
| 86 | 100 |
| 87 } // namespace blink | 101 } // namespace blink |
| 88 | 102 |
| 89 #endif // WebLocalFrame_h | 103 #endif // WebLocalFrame_h |
| OLD | NEW |