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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 content::BrowserContext* browser_context, | 337 content::BrowserContext* browser_context, |
337 int embedder_process_id, | 338 int embedder_process_id, |
338 int view_instance_id) { | 339 int view_instance_id) { |
339 // Clean up context menus for the WebView. | 340 // Clean up context menus for the WebView. |
340 auto menu_manager = | 341 auto menu_manager = |
341 MenuManager::Get(Profile::FromBrowserContext(browser_context)); | 342 MenuManager::Get(Profile::FromBrowserContext(browser_context)); |
342 menu_manager->RemoveAllContextItems( | 343 menu_manager->RemoveAllContextItems( |
343 MenuItem::ExtensionKey("", embedder_process_id, view_instance_id)); | 344 MenuItem::ExtensionKey("", embedder_process_id, view_instance_id)); |
344 } | 345 } |
345 | 346 |
| 347 void ChromeExtensionsBrowserClient::AttachExtensionTaskManagerTag( |
| 348 content::WebContents* web_contents, |
| 349 ViewType view_type) { |
| 350 switch (view_type) { |
| 351 case VIEW_TYPE_APP_WINDOW: |
| 352 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| 353 case VIEW_TYPE_EXTENSION_DIALOG: |
| 354 case VIEW_TYPE_EXTENSION_POPUP: |
| 355 case VIEW_TYPE_LAUNCHER_PAGE: |
| 356 case VIEW_TYPE_VIRTUAL_KEYBOARD: |
| 357 // These are the only types that are tracked by the ExtensionTag. |
| 358 task_management::WebContentsTags::CreateForExtension(web_contents, |
| 359 view_type); |
| 360 return; |
| 361 |
| 362 case VIEW_TYPE_BACKGROUND_CONTENTS: |
| 363 case VIEW_TYPE_PANEL: |
| 364 case VIEW_TYPE_TAB_CONTENTS: |
| 365 // Those types are tracked by other tags: |
| 366 // BACKGROUND_CONTENTS --> task_management::BackgroundContentsTag. |
| 367 // PANEL --> task_management::PanelTag. |
| 368 // TAB_CONTENTS --> task_management::TabContentsTag. |
| 369 // These tags are created and attached to the web_contents in other |
| 370 // locations, and they must be ignored here. |
| 371 return; |
| 372 |
| 373 case VIEW_TYPE_INVALID: |
| 374 NOTREACHED(); |
| 375 return; |
| 376 } |
| 377 } |
| 378 |
346 } // namespace extensions | 379 } // namespace extensions |
OLD | NEW |