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/app_view/app_view_guest.h" | 5 #include "extensions/browser/guest_view/app_view/app_view_guest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 app_runtime::OnEmbedRequested::kEventName); | 261 app_runtime::OnEmbedRequested::kEventName); |
262 if (!has_event_listener) { | 262 if (!has_event_listener) { |
263 callback.Run(nullptr); | 263 callback.Run(nullptr); |
264 return; | 264 return; |
265 } | 265 } |
266 | 266 |
267 std::unique_ptr<base::DictionaryValue> embed_request( | 267 std::unique_ptr<base::DictionaryValue> embed_request( |
268 new base::DictionaryValue()); | 268 new base::DictionaryValue()); |
269 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); | 269 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); |
270 embed_request->SetString(appview::kEmbedderID, owner_host()); | 270 embed_request->SetString(appview::kEmbedderID, owner_host()); |
271 embed_request->Set(appview::kData, data.release()); | 271 embed_request->Set(appview::kData, std::move(data)); |
272 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 272 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
273 browser_context(), std::move(embed_request), extension_host->extension()); | 273 browser_context(), std::move(embed_request), extension_host->extension()); |
274 } | 274 } |
275 | 275 |
276 void AppViewGuest::SetAppDelegateForTest(AppDelegate* delegate) { | 276 void AppViewGuest::SetAppDelegateForTest(AppDelegate* delegate) { |
277 app_delegate_.reset(delegate); | 277 app_delegate_.reset(delegate); |
278 } | 278 } |
279 | 279 |
280 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { | 280 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { |
281 std::vector<int> instances; | 281 std::vector<int> instances; |
282 for (const auto& key_value : pending_response_map.Get()) { | 282 for (const auto& key_value : pending_response_map.Get()) { |
283 instances.push_back(key_value.first); | 283 instances.push_back(key_value.first); |
284 } | 284 } |
285 return instances; | 285 return instances; |
286 } | 286 } |
287 | 287 |
288 } // namespace extensions | 288 } // namespace extensions |
OLD | NEW |