Chromium Code Reviews| 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 "chrome/browser/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/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 "chrome/browser/extensions/api/web_request/web_request_api.h" | 10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 | 180 |
| 181 // static | 181 // static |
| 182 int WebViewGuest::GetViewInstanceId(WebContents* contents) { | 182 int WebViewGuest::GetViewInstanceId(WebContents* contents) { |
| 183 WebViewGuest* guest = FromWebContents(contents); | 183 WebViewGuest* guest = FromWebContents(contents); |
| 184 if (!guest) | 184 if (!guest) |
| 185 return guestview::kInstanceIDNone; | 185 return guestview::kInstanceIDNone; |
| 186 | 186 |
| 187 return guest->view_instance_id(); | 187 return guest->view_instance_id(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 const char* WebViewGuest::GetAPINamespace() { | 190 const char* WebViewGuest::GetAPINamespace() const { |
| 191 return webview::kAPINamespace; | 191 return webview::kAPINamespace; |
| 192 } | 192 } |
| 193 | 193 |
| 194 int WebViewGuest::GetTaskPrefix() const { | |
| 195 if (!web_view_guest_delegate_) | |
| 196 return 0; | |
|
Charlie Reis
2014/08/25 20:25:41
Could we use IDS_TASK_MANAGER_WEBVIEW_TAG_PREFIX (
Fady Samuel
2014/08/25 23:05:52
Done.
| |
| 197 return web_view_guest_delegate_->GetTaskPrefix(); | |
| 198 } | |
| 199 | |
| 194 void WebViewGuest::CreateWebContents( | 200 void WebViewGuest::CreateWebContents( |
| 195 const std::string& embedder_extension_id, | 201 const std::string& embedder_extension_id, |
| 196 int embedder_render_process_id, | 202 int embedder_render_process_id, |
| 197 const base::DictionaryValue& create_params, | 203 const base::DictionaryValue& create_params, |
| 198 const WebContentsCreatedCallback& callback) { | 204 const WebContentsCreatedCallback& callback) { |
| 199 content::RenderProcessHost* embedder_render_process_host = | 205 content::RenderProcessHost* embedder_render_process_host = |
| 200 content::RenderProcessHost::FromID(embedder_render_process_id); | 206 content::RenderProcessHost::FromID(embedder_render_process_id); |
| 201 std::string storage_partition_id; | 207 std::string storage_partition_id; |
| 202 bool persist_storage = false; | 208 bool persist_storage = false; |
| 203 std::string storage_partition_string; | 209 std::string storage_partition_string; |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1122 WebViewGuest* guest = | 1128 WebViewGuest* guest = |
| 1123 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1129 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1124 if (!guest) | 1130 if (!guest) |
| 1125 return; | 1131 return; |
| 1126 | 1132 |
| 1127 if (!allow) | 1133 if (!allow) |
| 1128 guest->Destroy(); | 1134 guest->Destroy(); |
| 1129 } | 1135 } |
| 1130 | 1136 |
| 1131 } // namespace extensions | 1137 } // namespace extensions |
| OLD | NEW |