| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 webkit_prefs.allow_scripts_to_close_windows = true; | 508 webkit_prefs.allow_scripts_to_close_windows = true; |
| 509 | 509 |
| 510 // Disable anything that requires the GPU process for background pages. | 510 // Disable anything that requires the GPU process for background pages. |
| 511 // See http://crbug.com/64512 and http://crbug.com/64841. | 511 // See http://crbug.com/64512 and http://crbug.com/64841. |
| 512 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 512 if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 513 webkit_prefs.experimental_webgl_enabled = false; | 513 webkit_prefs.experimental_webgl_enabled = false; |
| 514 webkit_prefs.accelerated_compositing_enabled = false; | 514 webkit_prefs.accelerated_compositing_enabled = false; |
| 515 webkit_prefs.accelerated_2d_canvas_enabled = false; | 515 webkit_prefs.accelerated_2d_canvas_enabled = false; |
| 516 } | 516 } |
| 517 | 517 |
| 518 // TODO(dcheng): incorporate this setting into kClipboardPermission check. | |
| 519 webkit_prefs.javascript_can_access_clipboard = true; | |
| 520 | |
| 521 // TODO(dcheng): check kClipboardPermission instead once it's implemented. | |
| 522 if (extension_->HasApiPermission(Extension::kExperimentalPermission)) | |
| 523 webkit_prefs.dom_paste_enabled = true; | |
| 524 return webkit_prefs; | 518 return webkit_prefs; |
| 525 } | 519 } |
| 526 | 520 |
| 527 void ExtensionHost::ProcessWebUIMessage( | 521 void ExtensionHost::ProcessWebUIMessage( |
| 528 const ViewHostMsg_DomMessage_Params& params) { | 522 const ViewHostMsg_DomMessage_Params& params) { |
| 529 if (extension_function_dispatcher_.get()) { | 523 if (extension_function_dispatcher_.get()) { |
| 530 extension_function_dispatcher_->HandleRequest(params); | 524 extension_function_dispatcher_->HandleRequest(params); |
| 531 } | 525 } |
| 532 } | 526 } |
| 533 | 527 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 } | 807 } |
| 814 return window_id; | 808 return window_id; |
| 815 } | 809 } |
| 816 | 810 |
| 817 void ExtensionHost::OnRunFileChooser( | 811 void ExtensionHost::OnRunFileChooser( |
| 818 const ViewHostMsg_RunFileChooser_Params& params) { | 812 const ViewHostMsg_RunFileChooser_Params& params) { |
| 819 if (file_select_helper_.get() == NULL) | 813 if (file_select_helper_.get() == NULL) |
| 820 file_select_helper_.reset(new FileSelectHelper(profile())); | 814 file_select_helper_.reset(new FileSelectHelper(profile())); |
| 821 file_select_helper_->RunFileChooser(render_view_host_, params); | 815 file_select_helper_->RunFileChooser(render_view_host_, params); |
| 822 } | 816 } |
| OLD | NEW |