| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 webkit_prefs.allow_scripts_to_close_windows = true; | 531 webkit_prefs.allow_scripts_to_close_windows = true; |
| 532 | 532 |
| 533 // Disable anything that requires the GPU process for background pages. | 533 // Disable anything that requires the GPU process for background pages. |
| 534 // See http://crbug.com/64512 and http://crbug.com/64841. | 534 // See http://crbug.com/64512 and http://crbug.com/64841. |
| 535 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 535 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 536 webkit_prefs.experimental_webgl_enabled = false; | 536 webkit_prefs.experimental_webgl_enabled = false; |
| 537 webkit_prefs.accelerated_compositing_enabled = false; | 537 webkit_prefs.accelerated_compositing_enabled = false; |
| 538 webkit_prefs.accelerated_2d_canvas_enabled = false; | 538 webkit_prefs.accelerated_2d_canvas_enabled = false; |
| 539 } | 539 } |
| 540 | 540 |
| 541 // TODO(dcheng): incorporate this setting into kClipboardPermission check. | |
| 542 webkit_prefs.javascript_can_access_clipboard = true; | |
| 543 | |
| 544 // TODO(dcheng): check kClipboardPermission instead once it's implemented. | |
| 545 if (extension_->HasApiPermission(Extension::kExperimentalPermission)) | |
| 546 webkit_prefs.dom_paste_enabled = true; | |
| 547 return webkit_prefs; | 541 return webkit_prefs; |
| 548 } | 542 } |
| 549 | 543 |
| 550 void ExtensionHost::ProcessWebUIMessage( | 544 void ExtensionHost::ProcessWebUIMessage( |
| 551 const ExtensionHostMsg_DomMessage_Params& params) { | 545 const ExtensionHostMsg_DomMessage_Params& params) { |
| 552 if (extension_function_dispatcher_.get()) { | 546 if (extension_function_dispatcher_.get()) { |
| 553 extension_function_dispatcher_->HandleRequest(params); | 547 extension_function_dispatcher_->HandleRequest(params); |
| 554 } | 548 } |
| 555 } | 549 } |
| 556 | 550 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 return window_id; | 827 return window_id; |
| 834 } | 828 } |
| 835 | 829 |
| 836 void ExtensionHost::OnRunFileChooser( | 830 void ExtensionHost::OnRunFileChooser( |
| 837 const ViewHostMsg_RunFileChooser_Params& params) { | 831 const ViewHostMsg_RunFileChooser_Params& params) { |
| 838 if (file_select_helper_.get() == NULL) | 832 if (file_select_helper_.get() == NULL) |
| 839 file_select_helper_.reset(new FileSelectHelper(profile())); | 833 file_select_helper_.reset(new FileSelectHelper(profile())); |
| 840 file_select_helper_->RunFileChooser(render_view_host_, | 834 file_select_helper_->RunFileChooser(render_view_host_, |
| 841 associated_tab_contents(), params); | 835 associated_tab_contents(), params); |
| 842 } | 836 } |
| OLD | NEW |