| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_RENDER_VIEW_HOST_DELEGATE_H__ | 5 #ifndef CHROME_BROWSER_RENDER_VIEW_HOST_DELEGATE_H__ |
| 6 #define CHROME_BROWSER_RENDER_VIEW_HOST_DELEGATE_H__ | 6 #define CHROME_BROWSER_RENDER_VIEW_HOST_DELEGATE_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class FindInPage { | 50 class FindInPage { |
| 51 public: | 51 public: |
| 52 // A find operation in the current page completed. | 52 // A find operation in the current page completed. |
| 53 virtual void FindReply(int request_id, | 53 virtual void FindReply(int request_id, |
| 54 int number_of_matches, | 54 int number_of_matches, |
| 55 const gfx::Rect& selection_rect, | 55 const gfx::Rect& selection_rect, |
| 56 int active_match_ordinal, | 56 int active_match_ordinal, |
| 57 bool final_update) = 0; | 57 bool final_update) = 0; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Returns the current find in page delegate, if any. | 60 // Interface for saving web pages. |
| 61 virtual FindInPage* GetFindInPageDelegate() { return NULL; } | 61 class Save { |
| 62 public: |
| 63 // Notification that we get when we receive all savable links of |
| 64 // sub-resources for the current page, their referrers and list of frames |
| 65 // (include main frame and sub frames). |
| 66 virtual void OnReceivedSavableResourceLinksForCurrentPage( |
| 67 const std::vector<GURL>& resources_list, |
| 68 const std::vector<GURL>& referrers_list, |
| 69 const std::vector<GURL>& frames_list) = 0; |
| 70 |
| 71 // Notification that we get when we receive serialized html content data of |
| 72 // a specified web page from render process. The parameter frame_url |
| 73 // specifies what frame the data belongs. The parameter data contains the |
| 74 // available data for sending. The parameter status indicates the |
| 75 // serialization status, See |
| 76 // webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus for |
| 77 // the detail meaning of status. |
| 78 virtual void OnReceivedSerializedHtmlData(const GURL& frame_url, |
| 79 const std::string& data, |
| 80 int32 status) = 0; |
| 81 }; |
| 82 |
| 83 // Returns the current delegate associated with a feature. May be NULL. |
| 84 virtual FindInPage* GetFindInPageDelegate() const { return NULL; } |
| 85 virtual Save* GetSaveDelegate() const { return NULL; } |
| 62 | 86 |
| 63 // Retrieves the profile to be used. | 87 // Retrieves the profile to be used. |
| 64 virtual Profile* GetProfile() const = 0; | 88 virtual Profile* GetProfile() const = 0; |
| 65 | 89 |
| 66 // The page is trying to open a new page (e.g. a popup window). | 90 // The page is trying to open a new page (e.g. a popup window). |
| 67 virtual void CreateView(int route_id, HANDLE modal_dialog_event) { } | 91 virtual void CreateView(int route_id, HANDLE modal_dialog_event) { } |
| 68 | 92 |
| 69 // The page is trying to open a new widget (e.g. a select popup). | 93 // The page is trying to open a new widget (e.g. a select popup). |
| 70 virtual void CreateWidget(int route_id) { } | 94 virtual void CreateWidget(int route_id) { } |
| 71 | 95 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 308 |
| 285 // Notification when default plugin updates status of the missing plugin. | 309 // Notification when default plugin updates status of the missing plugin. |
| 286 virtual void OnMissingPluginStatus(int status) { } | 310 virtual void OnMissingPluginStatus(int status) { } |
| 287 | 311 |
| 288 // Notification from the renderer that a plugin instance has crashed. | 312 // Notification from the renderer that a plugin instance has crashed. |
| 289 virtual void OnCrashedPlugin(const std::wstring& plugin_path) { } | 313 virtual void OnCrashedPlugin(const std::wstring& plugin_path) { } |
| 290 | 314 |
| 291 // Notification from the renderer that JS runs out of memory. | 315 // Notification from the renderer that JS runs out of memory. |
| 292 virtual void OnJSOutOfMemory() { } | 316 virtual void OnJSOutOfMemory() { } |
| 293 | 317 |
| 294 // Notification that we get when we receive all savable links of | |
| 295 // sub-resources for the current page, their referrers and list of frames | |
| 296 // (include main frame and sub frames). | |
| 297 virtual void OnReceivedSavableResourceLinksForCurrentPage( | |
| 298 const std::vector<GURL>& resources_list, | |
| 299 const std::vector<GURL>& referrers_list, | |
| 300 const std::vector<GURL>& frames_list) { } | |
| 301 | |
| 302 // Notification that we get when we receive serialized html content data of a | |
| 303 // specified web page from render process. The parameter frame_url specifies | |
| 304 // what frame the data belongs. The parameter data contains the available | |
| 305 // data for sending. The parameter status indicates the serialization status, | |
| 306 // See webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus for | |
| 307 // the detail meaning of status. | |
| 308 virtual void OnReceivedSerializedHtmlData(const GURL& frame_url, | |
| 309 const std::string& data, | |
| 310 int32 status) { } | |
| 311 | |
| 312 // Notification whether we should close the page, after an explicit call to | 318 // Notification whether we should close the page, after an explicit call to |
| 313 // AttemptToClosePage. This is called before a cross-site request or before | 319 // AttemptToClosePage. This is called before a cross-site request or before |
| 314 // a tab/window is closed, to allow the appropriate renderer to approve or | 320 // a tab/window is closed, to allow the appropriate renderer to approve or |
| 315 // deny the request. |proceed| indicates whether the user chose to proceed. | 321 // deny the request. |proceed| indicates whether the user chose to proceed. |
| 316 virtual void ShouldClosePage(bool proceed) { } | 322 virtual void ShouldClosePage(bool proceed) { } |
| 317 | 323 |
| 318 // Called by ResourceDispatcherHost when a response for a pending cross-site | 324 // Called by ResourceDispatcherHost when a response for a pending cross-site |
| 319 // request is received. The ResourceDispatcherHost will pause the response | 325 // request is received. The ResourceDispatcherHost will pause the response |
| 320 // until the onunload handler of the previous renderer is run. | 326 // until the onunload handler of the previous renderer is run. |
| 321 virtual void OnCrossSiteResponse(int new_render_process_host_id, | 327 virtual void OnCrossSiteResponse(int new_render_process_host_id, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 339 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state) { } | 345 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state) { } |
| 340 | 346 |
| 341 // Notification that a request for install info has completed. | 347 // Notification that a request for install info has completed. |
| 342 virtual void OnDidGetApplicationInfo( | 348 virtual void OnDidGetApplicationInfo( |
| 343 int32 page_id, | 349 int32 page_id, |
| 344 const webkit_glue::WebApplicationInfo& app_info) { } | 350 const webkit_glue::WebApplicationInfo& app_info) { } |
| 345 }; | 351 }; |
| 346 | 352 |
| 347 #endif // CHROME_BROWSER_RENDER_VIEW_HOST_DELEGATE_H__ | 353 #endif // CHROME_BROWSER_RENDER_VIEW_HOST_DELEGATE_H__ |
| 348 | 354 |
| OLD | NEW |