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

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

Issue 200054: Hook up WebFrameClient, replacing many WebViewDelegate methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/temporary_glue.cc ('k') | webkit/glue/webframe_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 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class HistoryItem; 53 class HistoryItem;
54 class KURL; 54 class KURL;
55 class Node; 55 class Node;
56 class Range; 56 class Range;
57 class SubstituteData; 57 class SubstituteData;
58 struct WindowFeatures; 58 struct WindowFeatures;
59 } 59 }
60 60
61 namespace WebKit { 61 namespace WebKit {
62 class WebDataSourceImpl; 62 class WebDataSourceImpl;
63 class WebFrameClient;
63 } 64 }
64 65
65 // Implementation of WebFrame, note that this is a reference counted object. 66 // Implementation of WebFrame, note that this is a reference counted object.
66 class WebFrameImpl : public WebKit::WebFrame, 67 class WebFrameImpl : public WebKit::WebFrame,
67 public base::RefCounted<WebFrameImpl> { 68 public base::RefCounted<WebFrameImpl> {
68 public: 69 public:
69 // WebFrame methods: 70 // WebFrame methods:
70 virtual WebKit::WebString name() const; 71 virtual WebKit::WebString name() const;
71 virtual WebKit::WebURL url() const; 72 virtual WebKit::WebURL url() const;
72 virtual WebKit::WebURL favIconURL() const; 73 virtual WebKit::WebURL favIconURL() const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 virtual WebKit::WebDataSource* dataSource() const; 124 virtual WebKit::WebDataSource* dataSource() const;
124 virtual WebKit::WebHistoryItem previousHistoryItem() const; 125 virtual WebKit::WebHistoryItem previousHistoryItem() const;
125 virtual WebKit::WebHistoryItem currentHistoryItem() const; 126 virtual WebKit::WebHistoryItem currentHistoryItem() const;
126 virtual void enableViewSourceMode(bool enable); 127 virtual void enableViewSourceMode(bool enable);
127 virtual bool isViewSourceModeEnabled() const; 128 virtual bool isViewSourceModeEnabled() const;
128 virtual void setReferrerForRequest( 129 virtual void setReferrerForRequest(
129 WebKit::WebURLRequest& request, const WebKit::WebURL& referrer); 130 WebKit::WebURLRequest& request, const WebKit::WebURL& referrer);
130 virtual void dispatchWillSendRequest(WebKit::WebURLRequest& request); 131 virtual void dispatchWillSendRequest(WebKit::WebURLRequest& request);
131 virtual void commitDocumentData(const char* data, size_t length); 132 virtual void commitDocumentData(const char* data, size_t length);
132 virtual unsigned unloadListenerCount() const; 133 virtual unsigned unloadListenerCount() const;
134 virtual bool isProcessingUserGesture() const;
133 virtual void replaceSelection(const WebKit::WebString& text); 135 virtual void replaceSelection(const WebKit::WebString& text);
134 virtual void insertText(const WebKit::WebString& text); 136 virtual void insertText(const WebKit::WebString& text);
135 virtual void setMarkedText( 137 virtual void setMarkedText(
136 const WebKit::WebString& text, unsigned location, unsigned length); 138 const WebKit::WebString& text, unsigned location, unsigned length);
137 virtual void unmarkText(); 139 virtual void unmarkText();
138 virtual bool hasMarkedText() const; 140 virtual bool hasMarkedText() const;
139 virtual WebKit::WebRange markedRange() const; 141 virtual WebKit::WebRange markedRange() const;
140 virtual bool executeCommand(const WebKit::WebString& command); 142 virtual bool executeCommand(const WebKit::WebString& command);
141 virtual bool executeCommand( 143 virtual bool executeCommand(
142 const WebKit::WebString& command, const WebKit::WebString& value); 144 const WebKit::WebString& command, const WebKit::WebString& value);
(...skipping 19 matching lines...) Expand all
162 virtual void cancelPendingScopingEffort(); 164 virtual void cancelPendingScopingEffort();
163 virtual void increaseMatchCount(int count, int identifier); 165 virtual void increaseMatchCount(int count, int identifier);
164 virtual void reportFindInPageSelection( 166 virtual void reportFindInPageSelection(
165 const WebKit::WebRect& selection_rect, int active_match_ordinal, 167 const WebKit::WebRect& selection_rect, int active_match_ordinal,
166 int identifier); 168 int identifier);
167 virtual void resetMatchCount(); 169 virtual void resetMatchCount();
168 virtual WebKit::WebURL completeURL(const WebKit::WebString& url) const; 170 virtual WebKit::WebURL completeURL(const WebKit::WebString& url) const;
169 virtual WebKit::WebString contentAsText(size_t max_chars) const; 171 virtual WebKit::WebString contentAsText(size_t max_chars) const;
170 virtual WebKit::WebString contentAsMarkup() const; 172 virtual WebKit::WebString contentAsMarkup() const;
171 173
172 WebFrameImpl(); 174 WebFrameImpl(WebKit::WebFrameClient* client);
173 ~WebFrameImpl(); 175 ~WebFrameImpl();
174 176
175 static int live_object_count() { 177 static int live_object_count() {
176 return live_object_count_; 178 return live_object_count_;
177 } 179 }
178 180
179 // Called by the WebViewImpl to initialize its main frame: 181 // Called by the WebViewImpl to initialize its main frame:
180 void InitMainFrame(WebViewImpl* webview_impl); 182 void InitMainFrame(WebViewImpl* webview_impl);
181 183
182 PassRefPtr<WebCore::Frame> CreateChildFrame( 184 PassRefPtr<WebCore::Frame> CreateChildFrame(
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 PassRefPtr<WebCore::HTMLInputElement> user_name_input_element, 237 PassRefPtr<WebCore::HTMLInputElement> user_name_input_element,
236 webkit_glue::PasswordAutocompleteListener* listener); 238 webkit_glue::PasswordAutocompleteListener* listener);
237 239
238 // Returns the password autocomplete listener associated with the passed 240 // Returns the password autocomplete listener associated with the passed
239 // user name input element, or NULL if none available. 241 // user name input element, or NULL if none available.
240 // Note that the returned listener is owner by the WebFrameImpl and should not 242 // Note that the returned listener is owner by the WebFrameImpl and should not
241 // be kept around as it is deleted when the page goes away. 243 // be kept around as it is deleted when the page goes away.
242 webkit_glue::PasswordAutocompleteListener* GetPasswordListener( 244 webkit_glue::PasswordAutocompleteListener* GetPasswordListener(
243 WebCore::HTMLInputElement* user_name_input_element); 245 WebCore::HTMLInputElement* user_name_input_element);
244 246
247 WebKit::WebFrameClient* client() const { return client_; }
248 void drop_client() { client_ = NULL; }
249
245 protected: 250 protected:
246 friend class WebFrameLoaderClient; 251 friend class WebFrameLoaderClient;
247 252
248 // Informs the WebFrame that the Frame is being closed, called by the 253 // Informs the WebFrame that the Frame is being closed, called by the
249 // WebFrameLoaderClient 254 // WebFrameLoaderClient
250 void Closing(); 255 void Closing();
251 256
252 // Used to check for leaks of this object. 257 // Used to check for leaks of this object.
253 static int live_object_count_; 258 static int live_object_count_;
254 259
255 WebFrameLoaderClient frame_loader_client_; 260 WebFrameLoaderClient frame_loader_client_;
256 261
257 // This is a factory for creating cancelable tasks for this frame that run 262 // This is a factory for creating cancelable tasks for this frame that run
258 // asynchronously in order to scope string matches during a find operation. 263 // asynchronously in order to scope string matches during a find operation.
259 ScopedRunnableMethodFactory<WebFrameImpl> scope_matches_factory_; 264 ScopedRunnableMethodFactory<WebFrameImpl> scope_matches_factory_;
260 265
266 WebKit::WebFrameClient* client_;
267
261 // This is a weak pointer to our corresponding WebCore frame. A reference to 268 // This is a weak pointer to our corresponding WebCore frame. A reference to
262 // ourselves is held while frame_ is valid. See our Closing method. 269 // ourselves is held while frame_ is valid. See our Closing method.
263 WebCore::Frame* frame_; 270 WebCore::Frame* frame_;
264 271
265 // A way for the main frame to keep track of which frame has an active 272 // A way for the main frame to keep track of which frame has an active
266 // match. Should be NULL for all other frames. 273 // match. Should be NULL for all other frames.
267 WebFrameImpl* active_match_frame_; 274 WebFrameImpl* active_match_frame_;
268 275
269 // The range of the active match for the current frame. 276 // The range of the active match for the current frame.
270 RefPtr<WebCore::Range> active_match_; 277 RefPtr<WebCore::Range> active_match_;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // The input fields that are interested in edit events and their associated 363 // The input fields that are interested in edit events and their associated
357 // listeners. 364 // listeners.
358 typedef HashMap<RefPtr<WebCore::HTMLInputElement>, 365 typedef HashMap<RefPtr<WebCore::HTMLInputElement>,
359 webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap; 366 webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap;
360 PasswordListenerMap password_listeners_; 367 PasswordListenerMap password_listeners_;
361 368
362 DISALLOW_COPY_AND_ASSIGN(WebFrameImpl); 369 DISALLOW_COPY_AND_ASSIGN(WebFrameImpl);
363 }; 370 };
364 371
365 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_ 372 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/glue/temporary_glue.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698