OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/chrome_extensions_browser_client.h" | 5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/version.h" | 8 #include "base/version.h" |
9 #include "chrome/browser/app_mode/app_mode_utils.h" | 9 #include "chrome/browser/app_mode/app_mode_utils.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 #include "chrome/browser/extensions/chrome_url_request_util.h" | 24 #include "chrome/browser/extensions/chrome_url_request_util.h" |
25 #include "chrome/browser/extensions/error_console/error_console.h" | 25 #include "chrome/browser/extensions/error_console/error_console.h" |
26 #include "chrome/browser/extensions/event_router_forwarder.h" | 26 #include "chrome/browser/extensions/event_router_forwarder.h" |
27 #include "chrome/browser/extensions/extension_system_factory.h" | 27 #include "chrome/browser/extensions/extension_system_factory.h" |
28 #include "chrome/browser/extensions/extension_util.h" | 28 #include "chrome/browser/extensions/extension_util.h" |
29 #include "chrome/browser/extensions/menu_manager.h" | 29 #include "chrome/browser/extensions/menu_manager.h" |
30 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 30 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
31 #include "chrome/browser/net/chrome_net_log.h" | 31 #include "chrome/browser/net/chrome_net_log.h" |
32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
33 #include "chrome/browser/profiles/profile_manager.h" | 33 #include "chrome/browser/profiles/profile_manager.h" |
34 #include "chrome/browser/task_management/web_contents_tags.h" | |
34 #include "chrome/common/channel_info.h" | 35 #include "chrome/common/channel_info.h" |
35 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/extensions/features/feature_channel.h" | 38 #include "chrome/common/extensions/features/feature_channel.h" |
38 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
39 #include "components/version_info/version_info.h" | 40 #include "components/version_info/version_info.h" |
40 #include "content/public/browser/render_process_host.h" | 41 #include "content/public/browser/render_process_host.h" |
41 #include "extensions/browser/api/generated_api_registration.h" | 42 #include "extensions/browser/api/generated_api_registration.h" |
42 #include "extensions/browser/extension_function_registry.h" | 43 #include "extensions/browser/extension_function_registry.h" |
43 #include "extensions/browser/extension_prefs.h" | 44 #include "extensions/browser/extension_prefs.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 content::RenderProcessHost::FromID(embedder_process_id) | 339 content::RenderProcessHost::FromID(embedder_process_id) |
339 ->GetBrowserContext(); | 340 ->GetBrowserContext(); |
340 | 341 |
341 // Clean up context menus for the WebView. | 342 // Clean up context menus for the WebView. |
342 auto menu_manager = | 343 auto menu_manager = |
343 MenuManager::Get(Profile::FromBrowserContext(browser_context)); | 344 MenuManager::Get(Profile::FromBrowserContext(browser_context)); |
344 menu_manager->RemoveAllContextItems( | 345 menu_manager->RemoveAllContextItems( |
345 MenuItem::ExtensionKey("", embedder_process_id, view_instance_id)); | 346 MenuItem::ExtensionKey("", embedder_process_id, view_instance_id)); |
346 } | 347 } |
347 | 348 |
349 void ChromeExtensionsBrowserClient::AttachExtensionTaskManagerTag( | |
350 content::WebContents* web_contents, | |
351 ViewType view_type) { | |
352 switch (view_type) { | |
353 case VIEW_TYPE_APP_WINDOW: | |
354 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | |
355 case VIEW_TYPE_EXTENSION_DIALOG: | |
356 case VIEW_TYPE_EXTENSION_POPUP: | |
357 case VIEW_TYPE_LAUNCHER_PAGE: | |
358 case VIEW_TYPE_VIRTUAL_KEYBOARD: | |
359 // These are the only types that are tracked by the ExtensionTag. | |
360 task_management::WebContentsTags::CreateForExtension(web_contents); | |
361 return; | |
362 | |
363 case VIEW_TYPE_INVALID: | |
364 case VIEW_TYPE_BACKGROUND_CONTENTS: | |
365 case VIEW_TYPE_PANEL: | |
366 case VIEW_TYPE_TAB_CONTENTS: | |
Devlin
2015/08/04 16:05:07
I think it would be good to document which tags th
afakhry
2015/08/04 18:31:07
The PanelTag will be created in Panel::Initialize(
| |
367 // Those types are tracked by other tags, so they're ignored. | |
368 return; | |
369 | |
370 default: | |
Devlin
2015/08/04 16:05:07
Best to not have a default case. That way, if we
afakhry
2015/08/04 18:31:07
Done.
| |
371 // Added new types that are possibly not tracked by the task manager. | |
372 NOTREACHED(); | |
373 return; | |
374 } | |
375 } | |
376 | |
348 } // namespace extensions | 377 } // namespace extensions |
OLD | NEW |