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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android Created 5 years, 5 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 RenderFrameHost* GetParent() override; 132 RenderFrameHost* GetParent() override;
133 const std::string& GetFrameName() override; 133 const std::string& GetFrameName() override;
134 bool IsCrossProcessSubframe() override; 134 bool IsCrossProcessSubframe() override;
135 GURL GetLastCommittedURL() override; 135 GURL GetLastCommittedURL() override;
136 gfx::NativeView GetNativeView() override; 136 gfx::NativeView GetNativeView() override;
137 void AddMessageToConsole(ConsoleMessageLevel level, 137 void AddMessageToConsole(ConsoleMessageLevel level,
138 const std::string& message) override; 138 const std::string& message) override;
139 void ExecuteJavaScript(const base::string16& javascript) override; 139 void ExecuteJavaScript(const base::string16& javascript) override;
140 void ExecuteJavaScript(const base::string16& javascript, 140 void ExecuteJavaScript(const base::string16& javascript,
141 const JavaScriptResultCallback& callback) override; 141 const JavaScriptResultCallback& callback) override;
142 void ExecuteJavaScriptForTests(const base::string16& javascript) override;
143 void ExecuteJavaScriptForTests(
144 const base::string16& javascript,
145 const JavaScriptResultCallback& callback) override;
142 void ExecuteJavaScriptWithUserGestureForTests( 146 void ExecuteJavaScriptWithUserGestureForTests(
143 const base::string16& javascript) override; 147 const base::string16& javascript) override;
144 void ExecuteJavaScriptInIsolatedWorld( 148 void ExecuteJavaScriptInIsolatedWorld(
145 const base::string16& javascript, 149 const base::string16& javascript,
146 const JavaScriptResultCallback& callback, 150 const JavaScriptResultCallback& callback,
147 int world_id) override; 151 int world_id) override;
148 void ActivateFindInPageResultForAccessibility(int request_id) override; 152 void ActivateFindInPageResultForAccessibility(int request_id) override;
149 RenderViewHost* GetRenderViewHost() override; 153 RenderViewHost* GetRenderViewHost() override;
150 ServiceRegistry* GetServiceRegistry() override; 154 ServiceRegistry* GetServiceRegistry() override;
151 blink::WebPageVisibilityState GetVisibilityState() override; 155 blink::WebPageVisibilityState GetVisibilityState() override;
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 // part of the same site instance. 578 // part of the same site instance.
575 bool IsSameSiteInstance(RenderFrameHostImpl* other_render_frame_host); 579 bool IsSameSiteInstance(RenderFrameHostImpl* other_render_frame_host);
576 580
577 // Informs the content client that geolocation permissions were used. 581 // Informs the content client that geolocation permissions were used.
578 void DidUseGeolocationPermission(); 582 void DidUseGeolocationPermission();
579 583
580 void UpdatePermissionsForNavigation( 584 void UpdatePermissionsForNavigation(
581 const CommonNavigationParams& common_params, 585 const CommonNavigationParams& common_params,
582 const RequestNavigationParams& request_params); 586 const RequestNavigationParams& request_params);
583 587
588 // Returns true if the ExecuteJavaScript() API can be used on this host.
589 bool CanExecuteJavaScript();
590
584 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 591 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
585 // refcount that calls Shutdown when it reaches zero. This allows each 592 // refcount that calls Shutdown when it reaches zero. This allows each
586 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 593 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
587 // we have a RenderViewHost for each RenderFrameHost. 594 // we have a RenderViewHost for each RenderFrameHost.
588 // TODO(creis): RenderViewHost will eventually go away and be replaced with 595 // TODO(creis): RenderViewHost will eventually go away and be replaced with
589 // some form of page context. 596 // some form of page context.
590 RenderViewHostImpl* render_view_host_; 597 RenderViewHostImpl* render_view_host_;
591 598
592 RenderFrameHostDelegate* delegate_; 599 RenderFrameHostDelegate* delegate_;
593 600
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 751
745 // NOTE: This must be the last member. 752 // NOTE: This must be the last member.
746 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 753 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
747 754
748 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 755 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
749 }; 756 };
750 757
751 } // namespace content 758 } // namespace content
752 759
753 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 760 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698