| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "extensions/browser/api/extensions_api_client.h" | 32 #include "extensions/browser/api/extensions_api_client.h" |
| 33 #include "extensions/browser/extension_system.h" | 33 #include "extensions/browser/extension_system.h" |
| 34 #include "extensions/browser/guest_view/guest_view_constants.h" | 34 #include "extensions/browser/guest_view/guest_view_constants.h" |
| 35 #include "extensions/browser/guest_view/guest_view_manager.h" | 35 #include "extensions/browser/guest_view/guest_view_manager.h" |
| 36 #include "extensions/browser/guest_view/web_view/web_view_constants.h" | 36 #include "extensions/browser/guest_view/web_view/web_view_constants.h" |
| 37 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 37 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
| 38 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 38 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
| 39 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 39 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
| 40 #include "extensions/common/constants.h" | 40 #include "extensions/common/constants.h" |
| 41 #include "extensions/common/extension_messages.h" | 41 #include "extensions/common/extension_messages.h" |
| 42 #include "extensions/strings/grit/extensions_strings.h" |
| 42 #include "ipc/ipc_message_macros.h" | 43 #include "ipc/ipc_message_macros.h" |
| 43 #include "net/base/escape.h" | 44 #include "net/base/escape.h" |
| 44 #include "net/base/net_errors.h" | 45 #include "net/base/net_errors.h" |
| 45 #include "ui/base/models/simple_menu_model.h" | 46 #include "ui/base/models/simple_menu_model.h" |
| 46 | 47 |
| 47 using base::UserMetricsAction; | 48 using base::UserMetricsAction; |
| 48 using content::RenderFrameHost; | 49 using content::RenderFrameHost; |
| 49 using content::ResourceType; | 50 using content::ResourceType; |
| 50 using content::WebContents; | 51 using content::WebContents; |
| 51 | 52 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 166 |
| 166 // static | 167 // static |
| 167 int WebViewGuest::GetViewInstanceId(WebContents* contents) { | 168 int WebViewGuest::GetViewInstanceId(WebContents* contents) { |
| 168 WebViewGuest* guest = FromWebContents(contents); | 169 WebViewGuest* guest = FromWebContents(contents); |
| 169 if (!guest) | 170 if (!guest) |
| 170 return guestview::kInstanceIDNone; | 171 return guestview::kInstanceIDNone; |
| 171 | 172 |
| 172 return guest->view_instance_id(); | 173 return guest->view_instance_id(); |
| 173 } | 174 } |
| 174 | 175 |
| 175 const char* WebViewGuest::GetAPINamespace() { | 176 const char* WebViewGuest::GetAPINamespace() const { |
| 176 return webview::kAPINamespace; | 177 return webview::kAPINamespace; |
| 177 } | 178 } |
| 178 | 179 |
| 180 int WebViewGuest::GetTaskPrefix() const { |
| 181 return IDS_EXTENSION_TASK_MANAGER_WEBVIEW_TAG_PREFIX; |
| 182 } |
| 183 |
| 179 void WebViewGuest::CreateWebContents( | 184 void WebViewGuest::CreateWebContents( |
| 180 const std::string& embedder_extension_id, | 185 const std::string& embedder_extension_id, |
| 181 int embedder_render_process_id, | 186 int embedder_render_process_id, |
| 182 const base::DictionaryValue& create_params, | 187 const base::DictionaryValue& create_params, |
| 183 const WebContentsCreatedCallback& callback) { | 188 const WebContentsCreatedCallback& callback) { |
| 184 content::RenderProcessHost* embedder_render_process_host = | 189 content::RenderProcessHost* embedder_render_process_host = |
| 185 content::RenderProcessHost::FromID(embedder_render_process_id); | 190 content::RenderProcessHost::FromID(embedder_render_process_id); |
| 186 std::string storage_partition_id; | 191 std::string storage_partition_id; |
| 187 bool persist_storage = false; | 192 bool persist_storage = false; |
| 188 std::string storage_partition_string; | 193 std::string storage_partition_string; |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 WebViewGuest* guest = | 1105 WebViewGuest* guest = |
| 1101 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1106 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1102 if (!guest) | 1107 if (!guest) |
| 1103 return; | 1108 return; |
| 1104 | 1109 |
| 1105 if (!allow) | 1110 if (!allow) |
| 1106 guest->Destroy(); | 1111 guest->Destroy(); |
| 1107 } | 1112 } |
| 1108 | 1113 |
| 1109 } // namespace extensions | 1114 } // namespace extensions |
| OLD | NEW |