OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/api/guest_view/extension_view/extension_view_intern
al_api.h" | 5 #include "extensions/browser/api/guest_view/extension_view/extension_view_intern
al_api.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/crx_file/id_util.h" | 9 #include "components/crx_file/id_util.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
11 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
12 #include "content/public/browser/storage_partition.h" | 12 #include "content/public/browser/storage_partition.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/stop_find_action.h" | 14 #include "content/public/common/stop_find_action.h" |
15 #include "extensions/common/api/extension_view_internal.h" | 15 #include "extensions/common/api/extension_view_internal.h" |
16 #include "extensions/common/constants.h" | 16 #include "extensions/common/constants.h" |
17 | 17 |
18 namespace extensionview = extensions::core_api::extension_view_internal; | 18 namespace extensionview = extensions::api::extension_view_internal; |
19 | 19 |
20 namespace extensions { | 20 namespace extensions { |
21 | 21 |
22 bool ExtensionViewInternalExtensionFunction::RunAsync() { | 22 bool ExtensionViewInternalExtensionFunction::RunAsync() { |
23 int instance_id = 0; | 23 int instance_id = 0; |
24 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id)); | 24 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id)); |
25 ExtensionViewGuest* guest = ExtensionViewGuest::From( | 25 ExtensionViewGuest* guest = ExtensionViewGuest::From( |
26 render_frame_host()->GetProcess()->GetID(), instance_id); | 26 render_frame_host()->GetProcess()->GetID(), instance_id); |
27 if (!guest) | 27 if (!guest) |
28 return false; | 28 return false; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // the callback. | 79 // the callback. |
80 scoped_ptr<base::ListValue> result_list(new base::ListValue()); | 80 scoped_ptr<base::ListValue> result_list(new base::ListValue()); |
81 result_list->AppendBoolean(is_src_valid); | 81 result_list->AppendBoolean(is_src_valid); |
82 result_list->AppendString(url.host()); | 82 result_list->AppendString(url.host()); |
83 SetResultList(result_list.Pass()); | 83 SetResultList(result_list.Pass()); |
84 SendResponse(true); | 84 SendResponse(true); |
85 return true; | 85 return true; |
86 } | 86 } |
87 | 87 |
88 } // namespace extensions | 88 } // namespace extensions |
OLD | NEW |