Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: extensions/browser/guest_view/app_view/app_view_guest.cc

Issue 497843002: GuestViews should be able to specify task manager entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added DEPS Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/common/renderer_preferences.h" 9 #include "content/public/common/renderer_preferences.h"
10 #include "extensions/browser/api/app_runtime/app_runtime_api.h" 10 #include "extensions/browser/api/app_runtime/app_runtime_api.h"
11 #include "extensions/browser/api/extensions_api_client.h" 11 #include "extensions/browser/api/extensions_api_client.h"
12 #include "extensions/browser/event_router.h" 12 #include "extensions/browser/event_router.h"
13 #include "extensions/browser/extension_host.h" 13 #include "extensions/browser/extension_host.h"
14 #include "extensions/browser/extension_registry.h" 14 #include "extensions/browser/extension_registry.h"
15 #include "extensions/browser/extension_system.h" 15 #include "extensions/browser/extension_system.h"
16 #include "extensions/browser/guest_view/app_view/app_view_constants.h" 16 #include "extensions/browser/guest_view/app_view/app_view_constants.h"
17 #include "extensions/browser/guest_view/guest_view_manager.h" 17 #include "extensions/browser/guest_view/guest_view_manager.h"
18 #include "extensions/browser/lazy_background_task_queue.h" 18 #include "extensions/browser/lazy_background_task_queue.h"
19 #include "extensions/browser/process_manager.h" 19 #include "extensions/browser/process_manager.h"
20 #include "extensions/browser/view_type_utils.h" 20 #include "extensions/browser/view_type_utils.h"
21 #include "extensions/common/api/app_runtime.h" 21 #include "extensions/common/api/app_runtime.h"
22 #include "extensions/common/extension_messages.h" 22 #include "extensions/common/extension_messages.h"
23 #include "extensions/common/switches.h" 23 #include "extensions/common/switches.h"
24 #include "extensions/strings/grit/extensions_strings.h"
24 #include "ipc/ipc_message_macros.h" 25 #include "ipc/ipc_message_macros.h"
25 26
26 namespace app_runtime = extensions::core_api::app_runtime; 27 namespace app_runtime = extensions::core_api::app_runtime;
27 28
28 using content::RenderFrameHost; 29 using content::RenderFrameHost;
29 using content::WebContents; 30 using content::WebContents;
30 using extensions::ExtensionHost; 31 using extensions::ExtensionHost;
31 32
32 namespace extensions { 33 namespace extensions {
33 34
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 bool AppViewGuest::HandleContextMenu(const content::ContextMenuParams& params) { 128 bool AppViewGuest::HandleContextMenu(const content::ContextMenuParams& params) {
128 if (app_view_guest_delegate_) { 129 if (app_view_guest_delegate_) {
129 return app_view_guest_delegate_->HandleContextMenu(guest_web_contents(), 130 return app_view_guest_delegate_->HandleContextMenu(guest_web_contents(),
130 params); 131 params);
131 } 132 }
132 return false; 133 return false;
133 } 134 }
134 135
135 const char* AppViewGuest::GetAPINamespace() { 136 const char* AppViewGuest::GetAPINamespace() const {
136 return appview::kEmbedderAPINamespace; 137 return appview::kEmbedderAPINamespace;
137 } 138 }
138 139
140 int AppViewGuest::GetTaskPrefix() const {
141 return IDS_EXTENSION_TASK_MANAGER_APPVIEW_TAG_PREFIX;
142 }
143
139 void AppViewGuest::CreateWebContents( 144 void AppViewGuest::CreateWebContents(
140 const std::string& embedder_extension_id, 145 const std::string& embedder_extension_id,
141 int embedder_render_process_id, 146 int embedder_render_process_id,
142 const base::DictionaryValue& create_params, 147 const base::DictionaryValue& create_params,
143 const WebContentsCreatedCallback& callback) { 148 const WebContentsCreatedCallback& callback) {
144 std::string app_id; 149 std::string app_id;
145 if (!create_params.GetString(appview::kAppID, &app_id)) { 150 if (!create_params.GetString(appview::kAppID, &app_id)) {
146 callback.Run(NULL); 151 callback.Run(NULL);
147 return; 152 return;
148 } 153 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 251
247 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); 252 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue());
248 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); 253 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id());
249 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); 254 embed_request->SetString(appview::kEmbedderID, embedder_extension_id());
250 embed_request->Set(appview::kData, data.release()); 255 embed_request->Set(appview::kData, data.release());
251 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( 256 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent(
252 browser_context(), embed_request.Pass(), extension_host->extension()); 257 browser_context(), embed_request.Pass(), extension_host->extension());
253 } 258 }
254 259
255 } // namespace extensions 260 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/app_view/app_view_guest.h ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698