OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 int new_request_id) = 0; | 241 int new_request_id) = 0; |
242 | 242 |
243 // Called the ResourceDispatcherHost's associate CrossSiteRequestHandler | 243 // Called the ResourceDispatcherHost's associate CrossSiteRequestHandler |
244 // when a cross-site navigation has been canceled. | 244 // when a cross-site navigation has been canceled. |
245 virtual void OnCrossSiteNavigationCanceled() = 0; | 245 virtual void OnCrossSiteNavigationCanceled() = 0; |
246 | 246 |
247 protected: | 247 protected: |
248 virtual ~RendererManagement() {} | 248 virtual ~RendererManagement() {} |
249 }; | 249 }; |
250 | 250 |
251 // BrowserIntegration -------------------------------------------------------- | |
252 // Functions that integrate with other browser services. | |
253 | |
254 class BrowserIntegration { | |
255 public: | |
256 // Notification the user has made a gesture while focus was on the | |
257 // page. This is used to avoid uninitiated user downloads (aka carpet | |
258 // bombing), see DownloadRequestLimiter for details. | |
259 virtual void OnUserGesture() = 0; | |
260 | |
261 // A find operation in the current page completed. | |
262 virtual void OnFindReply(int request_id, | |
263 int number_of_matches, | |
264 const gfx::Rect& selection_rect, | |
265 int active_match_ordinal, | |
266 bool final_update) = 0; | |
267 | |
268 // Navigate to the history entry for the given offset from the current | |
269 // position within the NavigationController. Makes no change if offset is | |
270 // not valid. | |
271 virtual void GoToEntryAtOffset(int offset) = 0; | |
272 | |
273 // Notification when default plugin updates status of the missing plugin. | |
274 virtual void OnMissingPluginStatus(int status) = 0; | |
275 | |
276 // Notification from the renderer that a plugin instance has crashed. | |
277 // | |
278 // BrowserIntegration isn't necessarily the best place for this, if you | |
279 // need to implement this function somewhere that doesn't need any other | |
280 // BrowserIntegration callbacks, feel free to move it elsewhere. | |
281 virtual void OnCrashedPlugin(const FilePath& plugin_path) = 0; | |
282 | |
283 // Notification that a worker process has crashed. | |
284 virtual void OnCrashedWorker() = 0; | |
285 | |
286 virtual void OnBlockedOutdatedPlugin(const string16& name, | |
287 const GURL& update_url) = 0; | |
288 | |
289 // Notification that a user's request to install an application has | |
290 // completed. | |
291 virtual void OnDidGetApplicationInfo( | |
292 int32 page_id, | |
293 const WebApplicationInfo& app_info) = 0; | |
294 | |
295 // Notification when an application programmatically requests installation. | |
296 virtual void OnInstallApplication( | |
297 const WebApplicationInfo& app_info) = 0; | |
298 | |
299 // Notification that the contents of the page has been loaded. | |
300 virtual void OnPageContents(const GURL& url, | |
301 int renderer_process_id, | |
302 int32 page_id, | |
303 const string16& contents, | |
304 const std::string& language, | |
305 bool page_translatable) = 0; | |
306 | |
307 // Notification that the page has been translated. | |
308 virtual void OnPageTranslated(int32 page_id, | |
309 const std::string& original_lang, | |
310 const std::string& translated_lang, | |
311 TranslateErrors::Type error_type) = 0; | |
312 | |
313 // Notification that the page has a suggest result. | |
314 virtual void OnSetSuggestions( | |
315 int32 page_id, | |
316 const std::vector<std::string>& result) = 0; | |
317 | |
318 // Notification of whether the page supports instant-style interaction. | |
319 virtual void OnInstantSupportDetermined(int32 page_id, bool result) = 0; | |
320 | |
321 protected: | |
322 virtual ~BrowserIntegration() {} | |
323 }; | |
324 | |
325 // ContentSettings------------------------------------------------------------ | 251 // ContentSettings------------------------------------------------------------ |
326 // Interface for content settings related events. | 252 // Interface for content settings related events. |
327 | 253 |
328 class ContentSettings { | 254 class ContentSettings { |
329 public: | 255 public: |
330 // Called when content in the current page was blocked due to the user's | 256 // Called when content in the current page was blocked due to the user's |
331 // content settings. | 257 // content settings. |
332 virtual void OnContentBlocked(ContentSettingsType type, | 258 virtual void OnContentBlocked(ContentSettingsType type, |
333 const std::string& resource_identifier) = 0; | 259 const std::string& resource_identifier) = 0; |
334 | 260 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 protected: | 458 protected: |
533 virtual ~FileSelect() {} | 459 virtual ~FileSelect() {} |
534 }; | 460 }; |
535 | 461 |
536 // --------------------------------------------------------------------------- | 462 // --------------------------------------------------------------------------- |
537 | 463 |
538 // Returns the current delegate associated with a feature. May return NULL if | 464 // Returns the current delegate associated with a feature. May return NULL if |
539 // there is no corresponding delegate. | 465 // there is no corresponding delegate. |
540 virtual View* GetViewDelegate(); | 466 virtual View* GetViewDelegate(); |
541 virtual RendererManagement* GetRendererManagementDelegate(); | 467 virtual RendererManagement* GetRendererManagementDelegate(); |
542 virtual BrowserIntegration* GetBrowserIntegrationDelegate(); | |
543 virtual ContentSettings* GetContentSettingsDelegate(); | 468 virtual ContentSettings* GetContentSettingsDelegate(); |
544 virtual Save* GetSaveDelegate(); | 469 virtual Save* GetSaveDelegate(); |
545 virtual Printing* GetPrintingDelegate(); | 470 virtual Printing* GetPrintingDelegate(); |
546 virtual FavIcon* GetFavIconDelegate(); | 471 virtual FavIcon* GetFavIconDelegate(); |
547 | 472 |
548 virtual BookmarkDrag* GetBookmarkDragDelegate(); | 473 virtual BookmarkDrag* GetBookmarkDragDelegate(); |
549 virtual SSL* GetSSLDelegate(); | 474 virtual SSL* GetSSLDelegate(); |
550 virtual FileSelect* GetFileSelectDelegate(); | 475 virtual FileSelect* GetFileSelectDelegate(); |
551 | 476 |
552 // Return the delegate for registering RenderViewHosts for automation resource | 477 // Return the delegate for registering RenderViewHosts for automation resource |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
701 virtual GURL GetAlternateErrorPageURL() const; | 626 virtual GURL GetAlternateErrorPageURL() const; |
702 | 627 |
703 // Return a dummy RendererPreferences object that will be used by the renderer | 628 // Return a dummy RendererPreferences object that will be used by the renderer |
704 // associated with the owning RenderViewHost. | 629 // associated with the owning RenderViewHost. |
705 virtual RendererPreferences GetRendererPrefs(Profile* profile) const = 0; | 630 virtual RendererPreferences GetRendererPrefs(Profile* profile) const = 0; |
706 | 631 |
707 // Returns a WebPreferences object that will be used by the renderer | 632 // Returns a WebPreferences object that will be used by the renderer |
708 // associated with the owning render view host. | 633 // associated with the owning render view host. |
709 virtual WebPreferences GetWebkitPrefs(); | 634 virtual WebPreferences GetWebkitPrefs(); |
710 | 635 |
636 // Notification the user has made a gesture while focus was on the | |
637 // page. This is used to avoid uninitiated user downloads (aka carpet | |
638 // bombing), see DownloadRequestLimiter for details. | |
639 virtual void OnUserGesture() {} | |
640 | |
711 // Notification from the renderer host that blocked UI event occurred. | 641 // Notification from the renderer host that blocked UI event occurred. |
712 // This happens when there are tab-modal dialogs. In this case, the | 642 // This happens when there are tab-modal dialogs. In this case, the |
713 // notification is needed to let us draw attention to the dialog (i.e. | 643 // notification is needed to let us draw attention to the dialog (i.e. |
714 // refocus on the modal dialog, flash title etc). | 644 // refocus on the modal dialog, flash title etc). |
715 virtual void OnIgnoredUIEvent() {} | 645 virtual void OnIgnoredUIEvent() {} |
716 | 646 |
717 // Notification from the renderer that JS runs out of memory. | 647 // Notification from the renderer that JS runs out of memory. |
718 virtual void OnJSOutOfMemory() {} | 648 virtual void OnJSOutOfMemory() {} |
719 | 649 |
720 // Notification that the renderer has become unresponsive. The | 650 // Notification that the renderer has become unresponsive. The |
(...skipping 17 matching lines...) Expand all Loading... | |
738 virtual void DidInsertCSS() {} | 668 virtual void DidInsertCSS() {} |
739 | 669 |
740 // A different node in the page got focused. | 670 // A different node in the page got focused. |
741 virtual void FocusedNodeChanged(bool is_editable_node) {} | 671 virtual void FocusedNodeChanged(bool is_editable_node) {} |
742 | 672 |
743 // Updates the minimum and maximum zoom percentages. | 673 // Updates the minimum and maximum zoom percentages. |
744 virtual void UpdateZoomLimits(int minimum_percent, | 674 virtual void UpdateZoomLimits(int minimum_percent, |
745 int maximum_percent, | 675 int maximum_percent, |
746 bool remember) {} | 676 bool remember) {} |
747 | 677 |
678 // Notification that a worker process has crashed. | |
679 void WorkerCrashed() {} | |
Evan Martin
2011/07/20 20:09:46
Missing 'virtual'. Dun dun dunnnnnnn. Review car
| |
680 | |
748 protected: | 681 protected: |
749 virtual ~RenderViewHostDelegate() {} | 682 virtual ~RenderViewHostDelegate() {} |
750 }; | 683 }; |
751 | 684 |
752 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 685 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |