| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 83 WebviewGoFunction::WebviewGoFunction() { |
| 84 } |
| 85 |
| 86 WebviewGoFunction::~WebviewGoFunction() { |
| 87 } |
| 88 |
| 89 bool WebviewGoFunction::RunImpl() { |
| 90 int instance_id; |
| 91 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id)); |
| 92 |
| 93 int relative_index; |
| 94 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &relative_index)); |
| 95 |
| 96 chrome::WebViewGuest* guest = chrome::WebViewGuest::From( |
| 97 render_view_host()->GetProcess()->GetID(), instance_id); |
| 98 if (!guest) |
| 99 return false; |
| 100 |
| 101 guest->Go(relative_index); |
| 102 return true; |
| 103 } |
| OLD | NEW |