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

Side by Side Diff: chrome/browser/extensions/api/webview/webview_api.cc

Issue 17165004: <webview>: Partially migrate loadcommit event from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 7 years, 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/extensions/api/webview/webview_api.h" 5 #include "chrome/browser/extensions/api/webview/webview_api.h"
6 6
7 #include "chrome/browser/extensions/tab_helper.h" 7 #include "chrome/browser/extensions/tab_helper.h"
8 #include "chrome/browser/webview/webview_guest.h" 8 #include "chrome/browser/webview/webview_guest.h"
9 #include "chrome/common/extensions/api/webview.h" 9 #include "chrome/common/extensions/api/webview.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 bool WebviewExecuteCodeFunction::ShouldInsertCSS() const { 46 bool WebviewExecuteCodeFunction::ShouldInsertCSS() const {
47 return false; 47 return false;
48 } 48 }
49 49
50 bool WebviewExecuteCodeFunction::CanExecuteScriptOnPage() { 50 bool WebviewExecuteCodeFunction::CanExecuteScriptOnPage() {
51 return true; 51 return true;
52 } 52 }
53 53
54 extensions::ScriptExecutor* WebviewExecuteCodeFunction::GetScriptExecutor() { 54 extensions::ScriptExecutor* WebviewExecuteCodeFunction::GetScriptExecutor() {
55 chrome::WebViewGuest* guest = chrome::WebViewGuest::From( 55 WebViewGuest* guest = WebViewGuest::From(
56 render_view_host()->GetProcess()->GetID(), guest_instance_id_); 56 render_view_host()->GetProcess()->GetID(), guest_instance_id_);
57 if (!guest) 57 if (!guest)
58 return NULL; 58 return NULL;
59 59
60 return guest->script_executor(); 60 return guest->script_executor();
61 } 61 }
62 62
63 bool WebviewExecuteCodeFunction::IsWebView() const { 63 bool WebviewExecuteCodeFunction::IsWebView() const {
64 return true; 64 return true;
65 } 65 }
66 66
67 void WebviewExecuteScriptFunction::OnExecuteCodeFinished( 67 void WebviewExecuteScriptFunction::OnExecuteCodeFinished(
68 const std::string& error, 68 const std::string& error,
69 int32 on_page_id, 69 int32 on_page_id,
70 const GURL& on_url, 70 const GURL& on_url,
71 const base::ListValue& result) { 71 const base::ListValue& result) {
72 content::RecordAction(content::UserMetricsAction("WebView.ExecuteScript")); 72 content::RecordAction(content::UserMetricsAction("WebView.ExecuteScript"));
73 if (error.empty()) 73 if (error.empty())
74 SetResult(result.DeepCopy()); 74 SetResult(result.DeepCopy());
75 WebviewExecuteCodeFunction::OnExecuteCodeFinished(error, on_page_id, on_url, 75 WebviewExecuteCodeFunction::OnExecuteCodeFinished(error, on_page_id, on_url,
76 result); 76 result);
77 } 77 }
78 78
79 bool WebviewInsertCSSFunction::ShouldInsertCSS() const { 79 bool WebviewInsertCSSFunction::ShouldInsertCSS() const {
80 return true; 80 return true;
81 } 81 }
82 82
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/extensions/extension_renderer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698