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

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 479006: re-apply r34183... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/gtk/gtk_theme_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/keyboard_codes.h" 11 #include "base/keyboard_codes.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/singleton.h" 13 #include "base/singleton.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "chrome/browser/browser.h" 15 #include "chrome/browser/browser.h"
16 #include "chrome/browser/browser_list.h" 16 #include "chrome/browser/browser_list.h"
17 #include "chrome/browser/browser_theme_provider.h" 17 #include "chrome/browser/browser_theme_provider.h"
18 #include "chrome/browser/browsing_instance.h" 18 #include "chrome/browser/browsing_instance.h"
19 #include "chrome/browser/debugger/devtools_manager.h" 19 #include "chrome/browser/debugger/devtools_manager.h"
20 #include "chrome/browser/dom_ui/dom_ui_factory.h" 20 #include "chrome/browser/dom_ui/dom_ui_factory.h"
21 #include "chrome/browser/extensions/extension_message_service.h" 21 #include "chrome/browser/extensions/extension_message_service.h"
22 #include "chrome/browser/extensions/extension_tabs_module.h" 22 #include "chrome/browser/extensions/extension_tabs_module.h"
23 #include "chrome/browser/jsmessage_box_handler.h" 23 #include "chrome/browser/jsmessage_box_handler.h"
24 #include "chrome/browser/profile.h" 24 #include "chrome/browser/profile.h"
25 #include "chrome/browser/renderer_host/render_view_host.h" 25 #include "chrome/browser/renderer_host/render_view_host.h"
26 #include "chrome/browser/renderer_host/render_process_host.h" 26 #include "chrome/browser/renderer_host/render_process_host.h"
27 #include "chrome/browser/renderer_host/render_widget_host.h" 27 #include "chrome/browser/renderer_host/render_widget_host.h"
28 #include "chrome/browser/renderer_host/render_widget_host_view.h" 28 #include "chrome/browser/renderer_host/render_widget_host_view.h"
29 #include "chrome/browser/renderer_host/site_instance.h" 29 #include "chrome/browser/renderer_host/site_instance.h"
30 #include "chrome/browser/renderer_preferences_util.h"
30 #include "chrome/browser/tab_contents/tab_contents.h" 31 #include "chrome/browser/tab_contents/tab_contents.h"
31 #include "chrome/browser/tab_contents/tab_contents_view.h" 32 #include "chrome/browser/tab_contents/tab_contents_view.h"
32 #include "chrome/common/bindings_policy.h" 33 #include "chrome/common/bindings_policy.h"
33 #include "chrome/common/extensions/extension.h" 34 #include "chrome/common/extensions/extension.h"
34 #include "chrome/common/notification_service.h" 35 #include "chrome/common/notification_service.h"
35 #include "chrome/common/platform_util.h"
36 #include "chrome/common/pref_names.h" 36 #include "chrome/common/pref_names.h"
37 #include "chrome/common/pref_service.h" 37 #include "chrome/common/pref_service.h"
38 #include "chrome/common/view_types.h" 38 #include "chrome/common/view_types.h"
39 #include "chrome/common/render_messages.h" 39 #include "chrome/common/render_messages.h"
40 #include "chrome/common/url_constants.h" 40 #include "chrome/common/url_constants.h"
41 #include "grit/browser_resources.h" 41 #include "grit/browser_resources.h"
42 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
43 #include "webkit/glue/context_menu.h" 43 #include "webkit/glue/context_menu.h"
44 44
45 #if defined(TOOLKIT_VIEWS) 45 #if defined(TOOLKIT_VIEWS)
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 void ExtensionHost::Close(RenderViewHost* render_view_host) { 409 void ExtensionHost::Close(RenderViewHost* render_view_host) {
410 if (extension_host_type_ == ViewType::EXTENSION_POPUP) { 410 if (extension_host_type_ == ViewType::EXTENSION_POPUP) {
411 NotificationService::current()->Notify( 411 NotificationService::current()->Notify(
412 NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, 412 NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
413 Source<Profile>(profile_), 413 Source<Profile>(profile_),
414 Details<ExtensionHost>(this)); 414 Details<ExtensionHost>(this));
415 } 415 }
416 } 416 }
417 417
418 RendererPreferences ExtensionHost::GetRendererPrefs() const { 418 RendererPreferences ExtensionHost::GetRendererPrefs(Profile* profile) const {
419 return platform_util::GetInitedRendererPreferences(); 419 return renderer_preferences_util::GetInitedRendererPreferences(profile);
420 } 420 }
421 421
422 WebPreferences ExtensionHost::GetWebkitPrefs() { 422 WebPreferences ExtensionHost::GetWebkitPrefs() {
423 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); 423 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs();
424 const bool kIsDomUI = true; 424 const bool kIsDomUI = true;
425 WebPreferences webkit_prefs = 425 WebPreferences webkit_prefs =
426 RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, kIsDomUI); 426 RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, kIsDomUI);
427 if (extension_host_type_ == ViewType::EXTENSION_POPUP) 427 if (extension_host_type_ == ViewType::EXTENSION_POPUP)
428 webkit_prefs.allow_scripts_to_close_windows = true; 428 webkit_prefs.allow_scripts_to_close_windows = true;
429 return webkit_prefs; 429 return webkit_prefs;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 window_id = ExtensionTabUtil::GetWindowId( 611 window_id = ExtensionTabUtil::GetWindowId(
612 const_cast<ExtensionHost* >(this)->GetBrowser()); 612 const_cast<ExtensionHost* >(this)->GetBrowser());
613 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { 613 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) {
614 // Background page is not attached to any browser window, so pass -1. 614 // Background page is not attached to any browser window, so pass -1.
615 window_id = -1; 615 window_id = -1;
616 } else { 616 } else {
617 NOTREACHED(); 617 NOTREACHED();
618 } 618 }
619 return window_id; 619 return window_id;
620 } 620 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/gtk/gtk_theme_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698