Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/renderer/render_view.h

Issue 421005: Make executeScript and insertCSS inject code into all frames.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 void OnEnableViewSourceMode(); 603 void OnEnableViewSourceMode();
604 void OnEnablePreferredSizeChangedMode(); 604 void OnEnablePreferredSizeChangedMode();
605 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); 605 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs);
606 void OnMediaPlayerActionAt(const gfx::Point& location, 606 void OnMediaPlayerActionAt(const gfx::Point& location,
607 const WebKit::WebMediaPlayerAction& action); 607 const WebKit::WebMediaPlayerAction& action);
608 void OnNotifyRendererViewType(ViewType::Type view_type); 608 void OnNotifyRendererViewType(ViewType::Type view_type);
609 void OnUpdateBrowserWindowId(int window_id); 609 void OnUpdateBrowserWindowId(int window_id);
610 void OnExecuteCode(int request_id, 610 void OnExecuteCode(int request_id,
611 const std::string& extension_id, 611 const std::string& extension_id,
612 bool is_js_code, 612 bool is_js_code,
613 const std::string& code_string); 613 const std::string& code_string,
614 bool all_frames);
614 void ExecuteCodeImpl(WebKit::WebFrame* frame, 615 void ExecuteCodeImpl(WebKit::WebFrame* frame,
615 int request_id, 616 int request_id,
616 const std::string& extension_id, 617 const std::string& extension_id,
617 bool is_js_code, 618 bool is_js_code,
618 const std::string& code_string); 619 const std::string& code_string,
620 bool all_frames);
619 void OnUpdateBackForwardListCount(int back_list_count, 621 void OnUpdateBackForwardListCount(int back_list_count,
620 int forward_list_count); 622 int forward_list_count);
621 void OnGetAccessibilityInfo( 623 void OnGetAccessibilityInfo(
622 const webkit_glue::WebAccessibility::InParams& in_params, 624 const webkit_glue::WebAccessibility::InParams& in_params,
623 webkit_glue::WebAccessibility::OutParams* out_params); 625 webkit_glue::WebAccessibility::OutParams* out_params);
624 void OnClearAccessibilityInfo(int acc_obj_id, bool clear_all); 626 void OnClearAccessibilityInfo(int acc_obj_id, bool clear_all);
625 627
626 void OnExtensionMessageInvoke(const std::string& function_name, 628 void OnExtensionMessageInvoke(const std::string& function_name,
627 const ListValue& args); 629 const ListValue& args);
628 630
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 // information to the browser process. 674 // information to the browser process.
673 void BindDOMAutomationController(WebKit::WebFrame* webframe); 675 void BindDOMAutomationController(WebKit::WebFrame* webframe);
674 676
675 // Creates DevToolsClient and sets up JavaScript bindings for developer tools 677 // Creates DevToolsClient and sets up JavaScript bindings for developer tools
676 // UI that is going to be hosted by this RenderView. 678 // UI that is going to be hosted by this RenderView.
677 void CreateDevToolsClient(); 679 void CreateDevToolsClient();
678 680
679 // Locates a sub frame with given xpath 681 // Locates a sub frame with given xpath
680 WebKit::WebFrame* GetChildFrame(const std::wstring& frame_xpath) const; 682 WebKit::WebFrame* GetChildFrame(const std::wstring& frame_xpath) const;
681 683
684 // Get all child frames of parent_frame, returned by frames_vector.
685 bool GetAllChildFrames(WebKit::WebFrame* parent_frame,
686 std::vector<WebKit::WebFrame* >* frames_vector) const;
687
682 // Requests to download an image. When done, the RenderView is 688 // Requests to download an image. When done, the RenderView is
683 // notified by way of DidDownloadImage. Returns true if the request was 689 // notified by way of DidDownloadImage. Returns true if the request was
684 // successfully started, false otherwise. id is used to uniquely identify the 690 // successfully started, false otherwise. id is used to uniquely identify the
685 // request and passed back to the DidDownloadImage method. If the image has 691 // request and passed back to the DidDownloadImage method. If the image has
686 // multiple frames, the frame whose size is image_size is returned. If the 692 // multiple frames, the frame whose size is image_size is returned. If the
687 // image doesn't have a frame at the specified size, the first is returned. 693 // image doesn't have a frame at the specified size, the first is returned.
688 bool DownloadImage(int id, const GURL& image_url, int image_size); 694 bool DownloadImage(int id, const GURL& image_url, int image_size);
689 695
690 // This callback is triggered when DownloadImage completes, either 696 // This callback is triggered when DownloadImage completes, either
691 // succesfully or with a failure. See DownloadImage for more details. 697 // succesfully or with a failure. See DownloadImage for more details.
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 ViewType::Type view_type_; 952 ViewType::Type view_type_;
947 953
948 // Id number of browser window which RenderView is attached to. 954 // Id number of browser window which RenderView is attached to.
949 int browser_window_id_; 955 int browser_window_id_;
950 956
951 // If page is loading, we can't run code, just create CodeExecutionInfo 957 // If page is loading, we can't run code, just create CodeExecutionInfo
952 // objects store pending execution information and delay the execution until 958 // objects store pending execution information and delay the execution until
953 // page is loaded. 959 // page is loaded.
954 struct CodeExecutionInfo : public base::RefCounted<CodeExecutionInfo> { 960 struct CodeExecutionInfo : public base::RefCounted<CodeExecutionInfo> {
955 CodeExecutionInfo(int id_of_request, const std::string& id_of_extension, 961 CodeExecutionInfo(int id_of_request, const std::string& id_of_extension,
956 bool is_js, const std::string& code) 962 bool is_js, const std::string& code,
963 bool inject_to_all_frames)
957 : request_id(id_of_request), 964 : request_id(id_of_request),
958 extension_id(id_of_extension), 965 extension_id(id_of_extension),
959 code_string(code), 966 code_string(code),
960 is_js_code(is_js) {} 967 is_js_code(is_js),
968 all_frames(inject_to_all_frames) {}
961 int request_id; 969 int request_id;
962 970
963 // The id of extension who issues the pending executeScript API call. 971 // The id of extension who issues the pending executeScript API call.
964 std::string extension_id; 972 std::string extension_id;
965 973
966 // The code which would be executed. 974 // The code which would be executed.
967 std::string code_string; 975 std::string code_string;
968 976
969 // It's true if |code_string| is JavaScript; otherwise |code_string| is 977 // It's true if |code_string| is JavaScript; otherwise |code_string| is
970 // CSS text. 978 // CSS text.
971 bool is_js_code; 979 bool is_js_code;
980 // It's true if the code_string would be injected into all frames.
981 bool all_frames;
972 }; 982 };
973 983
974 std::queue<scoped_refptr<CodeExecutionInfo> > pending_code_execution_queue_; 984 std::queue<scoped_refptr<CodeExecutionInfo> > pending_code_execution_queue_;
975 985
976 // page id for the last navigation sent to the browser. 986 // page id for the last navigation sent to the browser.
977 int32 last_top_level_navigation_page_id_; 987 int32 last_top_level_navigation_page_id_;
978 988
979 #if defined(OS_MACOSX) 989 #if defined(OS_MACOSX)
980 // True if the current RenderView has been assigned a document tag. 990 // True if the current RenderView has been assigned a document tag.
981 bool has_document_tag_; 991 bool has_document_tag_;
(...skipping 12 matching lines...) Expand all
994 // ImageResourceFetchers schedule via DownloadImage. 1004 // ImageResourceFetchers schedule via DownloadImage.
995 typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet; 1005 typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet;
996 ImageResourceFetcherSet image_fetchers_; 1006 ImageResourceFetcherSet image_fetchers_;
997 1007
998 typedef std::map<WebKit::WebView*, RenderView*> ViewMap; 1008 typedef std::map<WebKit::WebView*, RenderView*> ViewMap;
999 1009
1000 DISALLOW_COPY_AND_ASSIGN(RenderView); 1010 DISALLOW_COPY_AND_ASSIGN(RenderView);
1001 }; 1011 };
1002 1012
1003 #endif // CHROME_RENDERER_RENDER_VIEW_H_ 1013 #endif // CHROME_RENDERER_RENDER_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698