| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| 11 | 11 |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "chrome/browser/renderer_host/render_widget_host.h" | 14 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 15 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 15 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 16 #include "chrome/common/content_settings_types.h" | 16 #include "chrome/common/content_settings_types.h" |
| 17 #include "chrome/common/page_zoom.h" | 17 #include "chrome/common/page_zoom.h" |
| 18 #include "chrome/common/render_view_commands.h" | |
| 19 #include "chrome/common/translate_errors.h" | 18 #include "chrome/common/translate_errors.h" |
| 20 #include "chrome/common/view_types.h" | 19 #include "chrome/common/view_types.h" |
| 21 #include "chrome/common/window_container_type.h" | 20 #include "chrome/common/window_container_type.h" |
| 22 #include "net/base/load_states.h" | 21 #include "net/base/load_states.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 27 #include "webkit/glue/webaccessibility.h" | 26 #include "webkit/glue/webaccessibility.h" |
| 28 #include "webkit/glue/window_open_disposition.h" | 27 #include "webkit/glue/window_open_disposition.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // for which another renderer will need to run an onunload event handler. | 195 // for which another renderer will need to run an onunload event handler. |
| 197 // This is called before the first navigation event for this RenderViewHost, | 196 // This is called before the first navigation event for this RenderViewHost, |
| 198 // and again after the corresponding OnCrossSiteResponse. | 197 // and again after the corresponding OnCrossSiteResponse. |
| 199 void SetHasPendingCrossSiteRequest(bool has_pending_request, int request_id); | 198 void SetHasPendingCrossSiteRequest(bool has_pending_request, int request_id); |
| 200 | 199 |
| 201 // Returns the request_id for the pending cross-site request. | 200 // Returns the request_id for the pending cross-site request. |
| 202 // This is just needed in case the unload of the current page | 201 // This is just needed in case the unload of the current page |
| 203 // hangs, in which case we need to swap to the pending RenderViewHost. | 202 // hangs, in which case we need to swap to the pending RenderViewHost. |
| 204 int GetPendingRequestId(); | 203 int GetPendingRequestId(); |
| 205 | 204 |
| 206 struct CommandState { | |
| 207 bool is_enabled; | |
| 208 RenderViewCommandCheckedState checked_state; | |
| 209 }; | |
| 210 CommandState GetStateForCommand(RenderViewCommand command) const; | |
| 211 | |
| 212 // Stops the current load. | 205 // Stops the current load. |
| 213 void Stop(); | 206 void Stop(); |
| 214 | 207 |
| 215 // Reloads the current frame. | 208 // Reloads the current frame. |
| 216 void ReloadFrame(); | 209 void ReloadFrame(); |
| 217 | 210 |
| 218 // Asks the renderer to "render" printed pages and initiate printing on our | 211 // Asks the renderer to "render" printed pages and initiate printing on our |
| 219 // behalf. | 212 // behalf. |
| 220 bool PrintPages(); | 213 bool PrintPages(); |
| 221 | 214 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 const string16& display_name, | 643 const string16& display_name, |
| 651 unsigned long estimated_size, | 644 unsigned long estimated_size, |
| 652 bool blocked_by_policy); | 645 bool blocked_by_policy); |
| 653 void OnUpdateZoomLimits(int minimum_percent, | 646 void OnUpdateZoomLimits(int minimum_percent, |
| 654 int maximum_percent, | 647 int maximum_percent, |
| 655 bool remember); | 648 bool remember); |
| 656 void OnDetectedPhishingSite(const GURL& phishing_url, double phishing_score); | 649 void OnDetectedPhishingSite(const GURL& phishing_url, double phishing_score); |
| 657 void OnScriptEvalResponse(int id, const ListValue& result); | 650 void OnScriptEvalResponse(int id, const ListValue& result); |
| 658 void OnPagesReadyForPreview( | 651 void OnPagesReadyForPreview( |
| 659 const ViewHostMsg_DidPreviewDocument_Params& params); | 652 const ViewHostMsg_DidPreviewDocument_Params& params); |
| 660 void OnCommandStateChanged(int command, | |
| 661 bool is_enabled, | |
| 662 int checked_state); | |
| 663 | 653 |
| 664 #if defined(OS_MACOSX) | 654 #if defined(OS_MACOSX) |
| 665 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 655 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 666 #endif | 656 #endif |
| 667 | 657 |
| 668 private: | 658 private: |
| 669 friend class TestRenderViewHost; | 659 friend class TestRenderViewHost; |
| 670 | 660 |
| 671 // Get/Create print preview tab. | 661 // Get/Create print preview tab. |
| 672 TabContents* GetOrCreatePrintPreviewTab(); | 662 TabContents* GetOrCreatePrintPreviewTab(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 731 |
| 742 // Whether the accessibility tree should be saved, for unit testing. | 732 // Whether the accessibility tree should be saved, for unit testing. |
| 743 bool save_accessibility_tree_for_testing_; | 733 bool save_accessibility_tree_for_testing_; |
| 744 | 734 |
| 745 // The most recently received accessibility tree - for unit testing only. | 735 // The most recently received accessibility tree - for unit testing only. |
| 746 webkit_glue::WebAccessibility accessibility_tree_; | 736 webkit_glue::WebAccessibility accessibility_tree_; |
| 747 | 737 |
| 748 // The termination status of the last render view that terminated. | 738 // The termination status of the last render view that terminated. |
| 749 base::TerminationStatus render_view_termination_status_; | 739 base::TerminationStatus render_view_termination_status_; |
| 750 | 740 |
| 751 // The enabled/disabled states of various commands. | |
| 752 std::map<RenderViewCommand, CommandState> command_states_; | |
| 753 | |
| 754 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 741 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 755 }; | 742 }; |
| 756 | 743 |
| 757 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 744 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |