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/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 bool success, | 474 bool success, |
475 const string16& user_input) { | 475 const string16& user_input) { |
476 render_view_host()->JavaScriptDialogClosed(reply_msg, | 476 render_view_host()->JavaScriptDialogClosed(reply_msg, |
477 success, | 477 success, |
478 user_input); | 478 user_input); |
479 } | 479 } |
480 | 480 |
481 void ExtensionHost::Close(RenderViewHost* render_view_host) { | 481 void ExtensionHost::Close(RenderViewHost* render_view_host) { |
482 if (extension_host_type_ == ViewType::EXTENSION_POPUP || | 482 if (extension_host_type_ == ViewType::EXTENSION_POPUP || |
483 extension_host_type_ == ViewType::EXTENSION_DIALOG || | 483 extension_host_type_ == ViewType::EXTENSION_DIALOG || |
| 484 extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE || |
484 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { | 485 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { |
485 NotificationService::current()->Notify( | 486 NotificationService::current()->Notify( |
486 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 487 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
487 Source<Profile>(profile_), | 488 Source<Profile>(profile_), |
488 Details<ExtensionHost>(this)); | 489 Details<ExtensionHost>(this)); |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 RendererPreferences ExtensionHost::GetRendererPrefs( | 493 RendererPreferences ExtensionHost::GetRendererPrefs( |
493 content::BrowserContext* browser_context) const { | 494 content::BrowserContext* browser_context) const { |
(...skipping 16 matching lines...) Expand all Loading... |
510 WebPreferences webkit_prefs = | 511 WebPreferences webkit_prefs = |
511 RenderViewHostDelegateHelper::GetWebkitPrefs(profile, | 512 RenderViewHostDelegateHelper::GetWebkitPrefs(profile, |
512 false); // is_web_ui | 513 false); // is_web_ui |
513 // Extensions are trusted so we override any user preferences for disabling | 514 // Extensions are trusted so we override any user preferences for disabling |
514 // javascript or images. | 515 // javascript or images. |
515 webkit_prefs.loads_images_automatically = true; | 516 webkit_prefs.loads_images_automatically = true; |
516 webkit_prefs.javascript_enabled = true; | 517 webkit_prefs.javascript_enabled = true; |
517 | 518 |
518 if (extension_host_type_ == ViewType::EXTENSION_POPUP || | 519 if (extension_host_type_ == ViewType::EXTENSION_POPUP || |
519 extension_host_type_ == ViewType::EXTENSION_DIALOG || | 520 extension_host_type_ == ViewType::EXTENSION_DIALOG || |
| 521 extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE || |
520 extension_host_type_ == ViewType::EXTENSION_INFOBAR) | 522 extension_host_type_ == ViewType::EXTENSION_INFOBAR) |
521 webkit_prefs.allow_scripts_to_close_windows = true; | 523 webkit_prefs.allow_scripts_to_close_windows = true; |
522 | 524 |
523 // Disable anything that requires the GPU process for background pages. | 525 // Disable anything that requires the GPU process for background pages. |
524 // See http://crbug.com/64512 and http://crbug.com/64841. | 526 // See http://crbug.com/64512 and http://crbug.com/64841. |
525 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 527 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
526 webkit_prefs.experimental_webgl_enabled = false; | 528 webkit_prefs.experimental_webgl_enabled = false; |
527 webkit_prefs.accelerated_compositing_enabled = false; | 529 webkit_prefs.accelerated_compositing_enabled = false; |
528 webkit_prefs.accelerated_2d_canvas_enabled = false; | 530 webkit_prefs.accelerated_2d_canvas_enabled = false; |
529 } | 531 } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 if (view_.get()) | 794 if (view_.get()) |
793 view_->RenderViewCreated(); | 795 view_->RenderViewCreated(); |
794 | 796 |
795 if (extension_host_type_ == ViewType::EXTENSION_POPUP || | 797 if (extension_host_type_ == ViewType::EXTENSION_POPUP || |
796 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { | 798 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { |
797 render_view_host->Send(new ViewMsg_EnablePreferredSizeChangedMode( | 799 render_view_host->Send(new ViewMsg_EnablePreferredSizeChangedMode( |
798 render_view_host->routing_id(), | 800 render_view_host->routing_id(), |
799 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow)); | 801 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow)); |
800 } | 802 } |
801 } | 803 } |
OLD | NEW |