| 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_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // for which another renderer will need to run an onunload event handler. | 194 // for which another renderer will need to run an onunload event handler. |
| 195 // This is called before the first navigation event for this RenderViewHost, | 195 // This is called before the first navigation event for this RenderViewHost, |
| 196 // and again after the corresponding OnCrossSiteResponse. | 196 // and again after the corresponding OnCrossSiteResponse. |
| 197 void SetHasPendingCrossSiteRequest(bool has_pending_request, int request_id); | 197 void SetHasPendingCrossSiteRequest(bool has_pending_request, int request_id); |
| 198 | 198 |
| 199 // Returns the request_id for the pending cross-site request. | 199 // Returns the request_id for the pending cross-site request. |
| 200 // This is just needed in case the unload of the current page | 200 // This is just needed in case the unload of the current page |
| 201 // hangs, in which case we need to swap to the pending RenderViewHost. | 201 // hangs, in which case we need to swap to the pending RenderViewHost. |
| 202 int GetPendingRequestId(); | 202 int GetPendingRequestId(); |
| 203 | 203 |
| 204 struct CommandState { |
| 205 bool is_enabled; |
| 206 int checked_state; |
| 207 }; |
| 208 CommandState GetStateForCommand(const std::string& command_name) const; |
| 209 |
| 204 // Stops the current load. | 210 // Stops the current load. |
| 205 void Stop(); | 211 void Stop(); |
| 206 | 212 |
| 207 // Reloads the current frame. | 213 // Reloads the current frame. |
| 208 void ReloadFrame(); | 214 void ReloadFrame(); |
| 209 | 215 |
| 210 // Asks the renderer to "render" printed pages and initiate printing on our | 216 // Asks the renderer to "render" printed pages and initiate printing on our |
| 211 // behalf. | 217 // behalf. |
| 212 bool PrintPages(); | 218 bool PrintPages(); |
| 213 | 219 |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 void OnSetSuggestions(int32 page_id, | 723 void OnSetSuggestions(int32 page_id, |
| 718 const std::vector<std::string>& suggestions); | 724 const std::vector<std::string>& suggestions); |
| 719 void OnInstantSupportDetermined(int32 page_id, bool result); | 725 void OnInstantSupportDetermined(int32 page_id, bool result); |
| 720 void OnDetectedPhishingSite(const GURL& phishing_url, | 726 void OnDetectedPhishingSite(const GURL& phishing_url, |
| 721 double phishing_score, | 727 double phishing_score, |
| 722 const SkBitmap& thumbnail); | 728 const SkBitmap& thumbnail); |
| 723 void OnScriptEvalResponse(int id, const ListValue& result); | 729 void OnScriptEvalResponse(int id, const ListValue& result); |
| 724 void OnUpdateContentRestrictions(int restrictions); | 730 void OnUpdateContentRestrictions(int restrictions); |
| 725 void OnPagesReadyForPreview( | 731 void OnPagesReadyForPreview( |
| 726 const ViewHostMsg_DidPreviewDocument_Params& params); | 732 const ViewHostMsg_DidPreviewDocument_Params& params); |
| 733 void OnCommandStateChanged(std::string command_name, |
| 734 bool is_enabled, |
| 735 int checked_state); |
| 727 | 736 |
| 728 #if defined(OS_MACOSX) | 737 #if defined(OS_MACOSX) |
| 729 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 738 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 730 #endif | 739 #endif |
| 731 | 740 |
| 732 private: | 741 private: |
| 733 friend class TestRenderViewHost; | 742 friend class TestRenderViewHost; |
| 734 | 743 |
| 735 // Get/Create print preview tab. | 744 // Get/Create print preview tab. |
| 736 TabContents* GetOrCreatePrintPreviewTab(); | 745 TabContents* GetOrCreatePrintPreviewTab(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 | 823 |
| 815 // Whether the accessibility tree should be saved, for unit testing. | 824 // Whether the accessibility tree should be saved, for unit testing. |
| 816 bool save_accessibility_tree_for_testing_; | 825 bool save_accessibility_tree_for_testing_; |
| 817 | 826 |
| 818 // The most recently received accessibility tree - for unit testing only. | 827 // The most recently received accessibility tree - for unit testing only. |
| 819 webkit_glue::WebAccessibility accessibility_tree_; | 828 webkit_glue::WebAccessibility accessibility_tree_; |
| 820 | 829 |
| 821 // The termination status of the last render view that terminated. | 830 // The termination status of the last render view that terminated. |
| 822 base::TerminationStatus render_view_termination_status_; | 831 base::TerminationStatus render_view_termination_status_; |
| 823 | 832 |
| 833 // The enabled/disabled states of various commands. |
| 834 std::map<std::string, CommandState> command_states_; |
| 835 |
| 824 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 836 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 825 }; | 837 }; |
| 826 | 838 |
| 827 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 839 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |