OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_RENDERER_RENDER_VIEW_H_ | 5 #ifndef CHROME_RENDERER_RENDER_VIEW_H_ |
6 #define CHROME_RENDERER_RENDER_VIEW_H_ | 6 #define CHROME_RENDERER_RENDER_VIEW_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <queue> | 10 #include <queue> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/gfx/point.h" | 15 #include "base/gfx/point.h" |
16 #include "base/gfx/rect.h" | 16 #include "base/gfx/rect.h" |
17 #include "base/id_map.h" | 17 #include "base/id_map.h" |
18 #include "base/shared_memory.h" | 18 #include "base/shared_memory.h" |
19 #include "base/timer.h" | 19 #include "base/timer.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "base/weak_ptr.h" | 21 #include "base/weak_ptr.h" |
22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
23 #include "chrome/common/edit_command.h" | 23 #include "chrome/common/edit_command.h" |
24 #include "chrome/common/navigation_gesture.h" | 24 #include "chrome/common/navigation_gesture.h" |
| 25 #include "chrome/common/notification_type.h" |
25 #include "chrome/common/renderer_preferences.h" | 26 #include "chrome/common/renderer_preferences.h" |
26 #include "chrome/common/view_types.h" | 27 #include "chrome/common/view_types.h" |
27 #include "chrome/renderer/automation/dom_automation_controller.h" | 28 #include "chrome/renderer/automation/dom_automation_controller.h" |
28 #include "chrome/renderer/dom_ui_bindings.h" | 29 #include "chrome/renderer/dom_ui_bindings.h" |
29 #include "chrome/renderer/extensions/extension_process_bindings.h" | 30 #include "chrome/renderer/extensions/extension_process_bindings.h" |
30 #include "chrome/renderer/external_host_bindings.h" | 31 #include "chrome/renderer/external_host_bindings.h" |
31 #include "chrome/renderer/render_widget.h" | 32 #include "chrome/renderer/render_widget.h" |
32 #include "third_party/skia/include/core/SkBitmap.h" | 33 #include "third_party/skia/include/core/SkBitmap.h" |
33 #include "testing/gtest/include/gtest/gtest_prod.h" | 34 #include "testing/gtest/include/gtest/gtest_prod.h" |
34 #include "webkit/api/public/WebConsoleMessage.h" | 35 #include "webkit/api/public/WebConsoleMessage.h" |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 void OnInstallMissingPlugin(); | 604 void OnInstallMissingPlugin(); |
604 void OnFileChooserResponse(const std::vector<FilePath>& file_names); | 605 void OnFileChooserResponse(const std::vector<FilePath>& file_names); |
605 void OnEnableViewSourceMode(); | 606 void OnEnableViewSourceMode(); |
606 void OnEnableIntrinsicWidthChangedMode(); | 607 void OnEnableIntrinsicWidthChangedMode(); |
607 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); | 608 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
608 void OnMediaPlayerActionAt(int x, | 609 void OnMediaPlayerActionAt(int x, |
609 int y, | 610 int y, |
610 const MediaPlayerAction& action); | 611 const MediaPlayerAction& action); |
611 void OnNotifyRendererViewType(ViewType::Type view_type); | 612 void OnNotifyRendererViewType(ViewType::Type view_type); |
612 void OnUpdateBrowserWindowId(int window_id); | 613 void OnUpdateBrowserWindowId(int window_id); |
| 614 void OnExecuteCode(int request_id, |
| 615 const std::string& extension_id, |
| 616 bool is_js_code, |
| 617 const std::string& code_string); |
613 void OnUpdateBackForwardListCount(int back_list_count, | 618 void OnUpdateBackForwardListCount(int back_list_count, |
614 int forward_list_count); | 619 int forward_list_count); |
615 void OnGetAccessibilityInfo( | 620 void OnGetAccessibilityInfo( |
616 const webkit_glue::WebAccessibility::InParams& in_params, | 621 const webkit_glue::WebAccessibility::InParams& in_params, |
617 webkit_glue::WebAccessibility::OutParams* out_params); | 622 webkit_glue::WebAccessibility::OutParams* out_params); |
618 void OnClearAccessibilityInfo(int acc_obj_id, bool clear_all); | 623 void OnClearAccessibilityInfo(int acc_obj_id, bool clear_all); |
619 | 624 |
620 void OnExtensionMessageInvoke(const std::string& function_name, | 625 void OnExtensionMessageInvoke(const std::string& function_name, |
621 const ListValue& args); | 626 const ListValue& args); |
622 | 627 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 | 907 |
903 RendererPreferences renderer_preferences_; | 908 RendererPreferences renderer_preferences_; |
904 | 909 |
905 // Type of view attached with RenderView, it could be INVALID, TAB_CONTENTS, | 910 // Type of view attached with RenderView, it could be INVALID, TAB_CONTENTS, |
906 // EXTENSION_TOOLSTRIP, EXTENSION_BACKGROUND_PAGE, DEV_TOOLS_UI. | 911 // EXTENSION_TOOLSTRIP, EXTENSION_BACKGROUND_PAGE, DEV_TOOLS_UI. |
907 ViewType::Type view_type_; | 912 ViewType::Type view_type_; |
908 | 913 |
909 // Id number of browser window which RenderView is attached to. | 914 // Id number of browser window which RenderView is attached to. |
910 int browser_window_id_; | 915 int browser_window_id_; |
911 | 916 |
| 917 // If page is loading, we can't run code, just create CodeExecutionInfo |
| 918 // objects store pending execution information and delay the execution until |
| 919 // page is loaded. |
| 920 struct CodeExecutionInfo : public base::RefCounted<CodeExecutionInfo> { |
| 921 CodeExecutionInfo(int id_of_request, const std::string& id_of_extension, |
| 922 bool is_js, const std::string& code) |
| 923 : request_id(id_of_request), |
| 924 extension_id(id_of_extension), |
| 925 code_string(code), |
| 926 is_js_code(is_js) {} |
| 927 int request_id; |
| 928 |
| 929 // The id of extension who issues the pending executeScript API call. |
| 930 std::string extension_id; |
| 931 |
| 932 // The code which would be executed. |
| 933 std::string code_string; |
| 934 |
| 935 // It's true if |code_string| is JavaScript; otherwise |code_string| is |
| 936 // CSS text. |
| 937 bool is_js_code; |
| 938 }; |
| 939 |
| 940 std::queue<scoped_refptr<CodeExecutionInfo> > pending_code_execution_queue_; |
| 941 |
912 // page id for the last navigation sent to the browser. | 942 // page id for the last navigation sent to the browser. |
913 int32 last_top_level_navigation_page_id_; | 943 int32 last_top_level_navigation_page_id_; |
914 | 944 |
915 #if defined(OS_MACOSX) | 945 #if defined(OS_MACOSX) |
916 // True if the current RenderView has been assigned a document tag. | 946 // True if the current RenderView has been assigned a document tag. |
917 bool has_document_tag_; | 947 bool has_document_tag_; |
918 #endif | 948 #endif |
919 | 949 |
920 // Document tag for this RenderView. | 950 // Document tag for this RenderView. |
921 int document_tag_; | 951 int document_tag_; |
922 | 952 |
923 // The settings this render view initialized WebKit with. | 953 // The settings this render view initialized WebKit with. |
924 WebPreferences webkit_preferences_; | 954 WebPreferences webkit_preferences_; |
925 | 955 |
926 // Stores edit commands associated to the next key event. | 956 // Stores edit commands associated to the next key event. |
927 // Shall be cleared as soon as the next key event is processed. | 957 // Shall be cleared as soon as the next key event is processed. |
928 EditCommands edit_commands_; | 958 EditCommands edit_commands_; |
929 | 959 |
930 DISALLOW_COPY_AND_ASSIGN(RenderView); | 960 DISALLOW_COPY_AND_ASSIGN(RenderView); |
931 }; | 961 }; |
932 | 962 |
933 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 963 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
OLD | NEW |