| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 WEBKIT_GLUE_WEBVIEW_H_ | 5 #ifndef WEBKIT_GLUE_WEBVIEW_H_ |
| 6 #define WEBKIT_GLUE_WEBVIEW_H_ | 6 #define WEBKIT_GLUE_WEBVIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 public: | 49 public: |
| 50 WebView() {} | 50 WebView() {} |
| 51 virtual ~WebView() {} | 51 virtual ~WebView() {} |
| 52 | 52 |
| 53 // This method creates a WebView that is NOT yet initialized. You will need | 53 // This method creates a WebView that is NOT yet initialized. You will need |
| 54 // to call InitializeMainFrame to finish the initialization. You may pass | 54 // to call InitializeMainFrame to finish the initialization. You may pass |
| 55 // NULL for the editing_client parameter if you are not interested in those | 55 // NULL for the editing_client parameter if you are not interested in those |
| 56 // notifications. | 56 // notifications. |
| 57 static WebView* Create(WebViewDelegate* delegate); | 57 static WebView* Create(WebViewDelegate* delegate); |
| 58 | 58 |
| 59 // After creating a WebView, you should immediately call this function. You | |
| 60 // can optionally modify the settings (via GetSettings()) in between. The | |
| 61 // frame_client will receive events for the main frame and any child frames. | |
| 62 virtual void InitializeMainFrame(WebKit::WebFrameClient* frame_client) = 0; | |
| 63 | |
| 64 // Tells all Page instances of this view to update the visited link state for | 59 // Tells all Page instances of this view to update the visited link state for |
| 65 // the specified hash. | 60 // the specified hash. |
| 66 static void UpdateVisitedLinkState(uint64 link_hash); | 61 static void UpdateVisitedLinkState(uint64 link_hash); |
| 67 | 62 |
| 68 // Tells all Page instances of this view to update visited state for all their | 63 // Tells all Page instances of this view to update visited state for all their |
| 69 // links. | 64 // links. |
| 70 static void ResetVisitedLinkState(); | 65 static void ResetVisitedLinkState(); |
| 71 | 66 |
| 72 // Returns the delegate for this WebView. This is the pointer that was | 67 // Returns the delegate for this WebView. This is the pointer that was |
| 73 // passed to WebView::Initialize. The caller must check this value before | 68 // passed to WebView::Initialize. The caller must check this value before |
| 74 // using it, it will be NULL during closing of the view. | 69 // using it, it will be NULL during closing of the view. |
| 75 virtual WebViewDelegate* GetDelegate() = 0; | 70 virtual WebViewDelegate* GetDelegate() = 0; |
| 76 | 71 |
| 77 // Method that controls whether pressing Tab key cycles through page elements | |
| 78 // or inserts a '\t' char in text area | |
| 79 virtual void SetTabKeyCyclesThroughElements(bool value) = 0; | |
| 80 | |
| 81 // Returns the frame previous to the specified frame, by traversing the frame | |
| 82 // tree, wrapping around if necessary. | |
| 83 virtual WebKit::WebFrame* GetPreviousFrameBefore(WebKit::WebFrame* frame, bool
wrap) = 0; | |
| 84 | |
| 85 // Returns the frame after to the specified frame, by traversing the frame | |
| 86 // tree, wrapping around if necessary. | |
| 87 virtual WebKit::WebFrame* GetNextFrameAfter(WebKit::WebFrame* frame, bool wrap
) = 0; | |
| 88 | |
| 89 // ---- TODO(darin): remove from here ---- | |
| 90 | |
| 91 // | |
| 92 // - (IBAction)stopLoading:(id)sender; | |
| 93 virtual void StopLoading() = 0; | |
| 94 | |
| 95 // Sets the maximum size to allow WebCore's internal B/F list to grow to. | |
| 96 // If not called, the list will have the default capacity specified in | |
| 97 // BackForwardList.cpp. | |
| 98 virtual void SetBackForwardListSize(int size) = 0; | |
| 99 | |
| 100 // ---- TODO(darin): remove to here ---- | |
| 101 | |
| 102 // Settings used by inspector. | 72 // Settings used by inspector. |
| 103 virtual const std::wstring& GetInspectorSettings() const = 0; | 73 virtual const std::wstring& GetInspectorSettings() const = 0; |
| 104 virtual void SetInspectorSettings(const std::wstring& settings) = 0; | 74 virtual void SetInspectorSettings(const std::wstring& settings) = 0; |
| 105 | 75 |
| 106 // Show the JavaScript console. | |
| 107 virtual void ShowJavaScriptConsole() = 0; | |
| 108 | |
| 109 // Helper method for drag and drop target operations: override the default | |
| 110 // drop effect with either a "copy" (accept true) or "none" (accept false) | |
| 111 // effect. Return true on success. | |
| 112 virtual bool SetDropEffect(bool accept) = 0; | |
| 113 | |
| 114 // Notifies the webview that autofill suggestions are available for a node. | 76 // Notifies the webview that autofill suggestions are available for a node. |
| 115 virtual void AutofillSuggestionsForNode( | 77 virtual void AutofillSuggestionsForNode( |
| 116 int64 node_id, | 78 int64 node_id, |
| 117 const std::vector<std::wstring>& suggestions, | 79 const std::vector<std::wstring>& suggestions, |
| 118 int default_suggestion_index) = 0; | 80 int default_suggestion_index) = 0; |
| 119 | 81 |
| 120 // Hides the autofill popup if any are showing. | 82 // Hides the autofill popup if any are showing. |
| 121 virtual void HideAutofillPopup() = 0; | 83 virtual void HideAutofillPopup() = 0; |
| 122 | 84 |
| 123 // Returns development tools agent instance belonging to this view. | 85 // Returns development tools agent instance belonging to this view. |
| 124 virtual WebDevToolsAgent* GetWebDevToolsAgent() = 0; | 86 virtual WebDevToolsAgent* GetWebDevToolsAgent() = 0; |
| 125 | 87 |
| 126 // Makes the webview transparent. Useful if you want to have some custom | |
| 127 // background behind it. | |
| 128 virtual void SetIsTransparent(bool is_transparent) = 0; | |
| 129 virtual bool GetIsTransparent() const = 0; | |
| 130 | |
| 131 virtual void SetSpellingPanelVisibility(bool is_visible) = 0; | 88 virtual void SetSpellingPanelVisibility(bool is_visible) = 0; |
| 132 virtual bool GetSpellingPanelVisibility() = 0; | 89 virtual bool GetSpellingPanelVisibility() = 0; |
| 133 | 90 |
| 134 virtual void SetTabsToLinks(bool enable) = 0; | |
| 135 virtual bool GetTabsToLinks() const = 0; | |
| 136 | |
| 137 // Performs an action from a context menu for the node at the given | 91 // Performs an action from a context menu for the node at the given |
| 138 // location. | 92 // location. |
| 139 virtual void MediaPlayerActionAt(int x, | 93 virtual void MediaPlayerActionAt(int x, |
| 140 int y, | 94 int y, |
| 141 const MediaPlayerAction& action) = 0; | 95 const MediaPlayerAction& action) = 0; |
| 142 | 96 |
| 143 // Updates the WebView's active state (i.e., control tints). | |
| 144 virtual void SetActive(bool active) = 0; | |
| 145 | |
| 146 // Gets the WebView's active state (i.e., state of control tints). | |
| 147 virtual bool IsActive() = 0; | |
| 148 | |
| 149 private: | 97 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(WebView); | 98 DISALLOW_COPY_AND_ASSIGN(WebView); |
| 151 }; | 99 }; |
| 152 | 100 |
| 153 #endif // WEBKIT_GLUE_WEBVIEW_H_ | 101 #endif // WEBKIT_GLUE_WEBVIEW_H_ |
| OLD | NEW |