OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/browser_shutdown.h" | 16 #include "chrome/browser/browser_shutdown.h" |
17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
18 #include "chrome/browser/extensions/extension_tab_util.h" | 18 #include "chrome/browser/extensions/extension_tab_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 20 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
26 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
| 27 #include "chrome/common/chrome_view_types.h" |
27 #include "chrome/common/extensions/extension.h" | 28 #include "chrome/common/extensions/extension.h" |
28 #include "chrome/common/extensions/extension_constants.h" | 29 #include "chrome/common/extensions/extension_constants.h" |
29 #include "chrome/common/extensions/extension_messages.h" | 30 #include "chrome/common/extensions/extension_messages.h" |
30 #include "chrome/common/render_messages.h" | 31 #include "chrome/common/render_messages.h" |
31 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
32 #include "chrome/common/chrome_view_types.h" | |
33 #include "content/browser/browsing_instance.h" | 33 #include "content/browser/browsing_instance.h" |
34 #include "content/browser/renderer_host/render_view_host.h" | 34 #include "content/browser/renderer_host/render_view_host.h" |
35 #include "content/browser/tab_contents/tab_contents.h" | 35 #include "content/browser/tab_contents/tab_contents.h" |
36 #include "content/browser/tab_contents/tab_contents_view.h" | 36 #include "content/browser/tab_contents/tab_contents_view.h" |
| 37 #include "content/public/browser/content_browser_client.h" |
| 38 #include "content/public/browser/native_web_keyboard_event.h" |
37 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
39 #include "content/public/browser/content_browser_client.h" | |
40 #include "content/public/browser/native_web_keyboard_event.h" | |
41 #include "grit/browser_resources.h" | 41 #include "grit/browser_resources.h" |
42 #include "grit/chromium_strings.h" | 42 #include "grit/chromium_strings.h" |
43 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
44 #include "ui/base/keycodes/keyboard_codes.h" | 44 #include "ui/base/keycodes/keyboard_codes.h" |
45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
47 | 47 |
48 #if defined(TOOLKIT_VIEWS) | 48 #if defined(TOOLKIT_VIEWS) |
49 #include "views/widget/widget.h" | 49 #include "ui/views/widget/widget.h" |
50 #endif | 50 #endif |
51 | 51 |
52 using WebKit::WebDragOperation; | 52 using WebKit::WebDragOperation; |
53 using WebKit::WebDragOperationsMask; | 53 using WebKit::WebDragOperationsMask; |
54 | 54 |
55 // Helper class that rate-limits the creation of renderer processes for | 55 // Helper class that rate-limits the creation of renderer processes for |
56 // ExtensionHosts, to avoid blocking the UI. | 56 // ExtensionHosts, to avoid blocking the UI. |
57 class ExtensionHost::ProcessCreationQueue { | 57 class ExtensionHost::ProcessCreationQueue { |
58 public: | 58 public: |
59 static ProcessCreationQueue* GetInstance() { | 59 static ProcessCreationQueue* GetInstance() { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); | 503 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); |
504 } | 504 } |
505 | 505 |
506 | 506 |
507 void ExtensionHost::RenderViewReady() { | 507 void ExtensionHost::RenderViewReady() { |
508 content::NotificationService::current()->Notify( | 508 content::NotificationService::current()->Notify( |
509 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 509 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
510 content::Source<Profile>(profile_), | 510 content::Source<Profile>(profile_), |
511 content::Details<ExtensionHost>(this)); | 511 content::Details<ExtensionHost>(this)); |
512 } | 512 } |
OLD | NEW |