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

Side by Side Diff: webkit/glue/webview_impl.h

Issue 151195: Simplifying renderer focus management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webview.h ('k') | webkit/glue/webview_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 (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_IMPL_H_ 5 #ifndef WEBKIT_GLUE_WEBVIEW_IMPL_H_
6 #define WEBKIT_GLUE_WEBVIEW_IMPL_H_ 6 #define WEBKIT_GLUE_WEBVIEW_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 virtual WebFrame* GetPreviousFrameBefore(WebFrame* frame, bool wrap); 66 virtual WebFrame* GetPreviousFrameBefore(WebFrame* frame, bool wrap);
67 virtual WebFrame* GetNextFrameAfter(WebFrame* frame, bool wrap); 67 virtual WebFrame* GetNextFrameAfter(WebFrame* frame, bool wrap);
68 virtual void Resize(const WebKit::WebSize& new_size); 68 virtual void Resize(const WebKit::WebSize& new_size);
69 virtual WebKit::WebSize GetSize() { return size(); } 69 virtual WebKit::WebSize GetSize() { return size(); }
70 virtual void Layout(); 70 virtual void Layout();
71 virtual void Paint(skia::PlatformCanvas* canvas, const WebKit::WebRect& rect); 71 virtual void Paint(skia::PlatformCanvas* canvas, const WebKit::WebRect& rect);
72 virtual bool HandleInputEvent(const WebKit::WebInputEvent* input_event); 72 virtual bool HandleInputEvent(const WebKit::WebInputEvent* input_event);
73 virtual void MouseCaptureLost(); 73 virtual void MouseCaptureLost();
74 virtual void SetFocus(bool enable); 74 virtual void SetFocus(bool enable);
75 virtual void ClearFocusedNode(); 75 virtual void ClearFocusedNode();
76 virtual void StoreFocusForFrame(WebFrame* frame);
77 virtual bool ImeSetComposition(int string_type, 76 virtual bool ImeSetComposition(int string_type,
78 int cursor_position, 77 int cursor_position,
79 int target_start, 78 int target_start,
80 int target_end, 79 int target_end,
81 const std::wstring& ime_string); 80 const std::wstring& ime_string);
82 virtual bool ImeUpdateStatus(bool* enable_ime, 81 virtual bool ImeUpdateStatus(bool* enable_ime,
83 WebKit::WebRect* caret_rect); 82 WebKit::WebRect* caret_rect);
84 virtual void SetTextDirection(WebTextDirection direction); 83 virtual void SetTextDirection(WebTextDirection direction);
85 virtual void StopLoading(); 84 virtual void StopLoading();
86 virtual void SetBackForwardListSize(int size); 85 virtual void SetBackForwardListSize(int size);
87 virtual void RestoreFocus();
88 virtual void SetInitialFocus(bool reverse); 86 virtual void SetInitialFocus(bool reverse);
89 virtual bool DownloadImage(int id, const GURL& image_url, int image_size); 87 virtual bool DownloadImage(int id, const GURL& image_url, int image_size);
90 virtual void SetPreferences(const WebPreferences& preferences); 88 virtual void SetPreferences(const WebPreferences& preferences);
91 virtual const WebPreferences& GetPreferences(); 89 virtual const WebPreferences& GetPreferences();
92 virtual void SetPageEncoding(const std::wstring& encoding_name); 90 virtual void SetPageEncoding(const std::wstring& encoding_name);
93 virtual std::wstring GetMainFrameEncodingName(); 91 virtual std::wstring GetMainFrameEncodingName();
94 virtual void ZoomIn(bool text_only); 92 virtual void ZoomIn(bool text_only);
95 virtual void ZoomOut(bool text_only); 93 virtual void ZoomOut(bool text_only);
96 virtual void ResetZoom(); 94 virtual void ResetZoom();
97 virtual void CopyImageAt(int x, int y); 95 virtual void CopyImageAt(int x, int y);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 179
182 // Handles context menu events orignated via the the keyboard. These 180 // Handles context menu events orignated via the the keyboard. These
183 // include the VK_APPS virtual key and the Shift+F10 combine. 181 // include the VK_APPS virtual key and the Shift+F10 combine.
184 // Code is based on the Webkit function 182 // Code is based on the Webkit function
185 // bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) in 183 // bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) in
186 // webkit\webkit\win\WebView.cpp. The only significant change in this 184 // webkit\webkit\win\WebView.cpp. The only significant change in this
187 // function is the code to convert from a Keyboard event to the Right 185 // function is the code to convert from a Keyboard event to the Right
188 // Mouse button down event. 186 // Mouse button down event.
189 bool SendContextMenuEvent(const WebKit::WebKeyboardEvent& event); 187 bool SendContextMenuEvent(const WebKit::WebKeyboardEvent& event);
190 188
191 // Releases references used to restore focus.
192 void ReleaseFocusReferences();
193
194 // Notifies the WebView that a load has been committed. 189 // Notifies the WebView that a load has been committed.
195 // is_new_navigation will be true if a new session history item should be 190 // is_new_navigation will be true if a new session history item should be
196 // created for that load. 191 // created for that load.
197 void DidCommitLoad(bool* is_new_navigation); 192 void DidCommitLoad(bool* is_new_navigation);
198 193
199 bool context_menu_allowed() const { 194 bool context_menu_allowed() const {
200 return context_menu_allowed_; 195 return context_menu_allowed_;
201 } 196 }
202 197
203 // Set the disposition for how this webview is to be initially shown. 198 // Set the disposition for how this webview is to be initially shown.
(...skipping 27 matching lines...) Expand all
231 ~WebViewImpl(); 226 ~WebViewImpl();
232 227
233 void ModifySelection(uint32 message, 228 void ModifySelection(uint32 message,
234 WebCore::Frame* frame, 229 WebCore::Frame* frame,
235 const WebCore::PlatformKeyboardEvent& e); 230 const WebCore::PlatformKeyboardEvent& e);
236 231
237 scoped_refptr<WebViewDelegate> delegate_; 232 scoped_refptr<WebViewDelegate> delegate_;
238 WebKit::WebSize size_; 233 WebKit::WebSize size_;
239 234
240 WebKit::WebPoint last_mouse_position_; 235 WebKit::WebPoint last_mouse_position_;
241 // Reference to the Frame that last had focus. This is set once when
242 // we lose focus, and used when focus is gained to reinstall focus to
243 // the correct element.
244 RefPtr<WebCore::Frame> last_focused_frame_;
245 // Reference to the node that last had focus.
246 RefPtr<WebCore::Node> last_focused_node_;
247 scoped_ptr<WebCore::Page> page_; 236 scoped_ptr<WebCore::Page> page_;
248 237
249 webkit_glue::BackForwardListClientImpl back_forward_list_client_impl_; 238 webkit_glue::BackForwardListClientImpl back_forward_list_client_impl_;
250 239
251 // This flag is set when a new navigation is detected. It is used to satisfy 240 // This flag is set when a new navigation is detected. It is used to satisfy
252 // the corresponding argument to WebViewDelegate::DidCommitLoadForFrame. 241 // the corresponding argument to WebViewDelegate::DidCommitLoadForFrame.
253 bool observed_new_navigation_; 242 bool observed_new_navigation_;
254 #ifndef NDEBUG 243 #ifndef NDEBUG
255 // Used to assert that the new navigation we observed is the same navigation 244 // Used to assert that the new navigation we observed is the same navigation
256 // when we make use of observed_new_navigation_. 245 // when we make use of observed_new_navigation_.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 static const WebKit::WebInputEvent* current_input_event() { 352 static const WebKit::WebInputEvent* current_input_event() {
364 return g_current_input_event; 353 return g_current_input_event;
365 } 354 }
366 private: 355 private:
367 static const WebKit::WebInputEvent* g_current_input_event; 356 static const WebKit::WebInputEvent* g_current_input_event;
368 357
369 DISALLOW_COPY_AND_ASSIGN(WebViewImpl); 358 DISALLOW_COPY_AND_ASSIGN(WebViewImpl);
370 }; 359 };
371 360
372 #endif // WEBKIT_GLUE_WEBVIEW_IMPL_H_ 361 #endif // WEBKIT_GLUE_WEBVIEW_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/glue/webview.h ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698