Chromium Code Reviews| 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 562 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_method_factory_(this)), | 562 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_method_factory_(this)), |
| 563 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), | 563 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), |
| 564 ALLOW_THIS_IN_INITIALIZER_LIST(translate_helper_(this)), | 564 ALLOW_THIS_IN_INITIALIZER_LIST(translate_helper_(this)), |
| 565 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 565 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
| 566 devtools_client_(NULL), | 566 devtools_client_(NULL), |
| 567 geolocation_dispatcher_(NULL), | 567 geolocation_dispatcher_(NULL), |
| 568 speech_input_dispatcher_(NULL), | 568 speech_input_dispatcher_(NULL), |
| 569 device_orientation_dispatcher_(NULL), | 569 device_orientation_dispatcher_(NULL), |
| 570 accessibility_ack_pending_(false), | 570 accessibility_ack_pending_(false), |
| 571 pending_app_icon_requests_(0), | 571 pending_app_icon_requests_(0), |
| 572 session_storage_namespace_id_(session_storage_namespace_id) { | 572 session_storage_namespace_id_(session_storage_namespace_id), |
| 573 has_saved_context_menu_action_(false), | |
| 574 saved_context_menu_action_(0) { | |
| 573 #if defined(OS_MACOSX) | 575 #if defined(OS_MACOSX) |
| 574 // On Mac, the select popups are rendered by the browser. | 576 // On Mac, the select popups are rendered by the browser. |
| 575 // Note that we don't do this in RenderMain otherwise this would not be called | 577 // Note that we don't do this in RenderMain otherwise this would not be called |
| 576 // in single-process mode. | 578 // in single-process mode. |
| 577 WebKit::WebView::setUseExternalPopupMenus(true); | 579 WebKit::WebView::setUseExternalPopupMenus(true); |
| 578 #endif | 580 #endif |
| 579 | 581 |
| 580 ClearBlockedContentSettings(); | 582 ClearBlockedContentSettings(); |
| 581 if (CommandLine::ForCurrentProcess()->HasSwitch( | 583 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 582 switches::kEnableClientSidePhishingDetection)) { | 584 switches::kEnableClientSidePhishingDetection)) { |
| (...skipping 4122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4705 | 4707 |
| 4706 void RenderView::OnUpdateWebPreferences(const WebPreferences& prefs) { | 4708 void RenderView::OnUpdateWebPreferences(const WebPreferences& prefs) { |
| 4707 webkit_preferences_ = prefs; | 4709 webkit_preferences_ = prefs; |
| 4708 webkit_preferences_.Apply(webview()); | 4710 webkit_preferences_.Apply(webview()); |
| 4709 } | 4711 } |
| 4710 | 4712 |
| 4711 void RenderView::OnSetAltErrorPageURL(const GURL& url) { | 4713 void RenderView::OnSetAltErrorPageURL(const GURL& url) { |
| 4712 alternate_error_page_url_ = url; | 4714 alternate_error_page_url_ = url; |
| 4713 } | 4715 } |
| 4714 | 4716 |
| 4715 void RenderView::OnCustomContextMenuAction(unsigned action) { | 4717 void RenderView::OnCustomContextMenuAction( |
| 4716 webview()->performCustomContextMenuAction(action); | 4718 const webkit_glue::CustomContextMenuContext& custom_context, |
| 4719 unsigned action) { | |
| 4720 if (custom_context.is_pepper_menu) { | |
| 4721 // Just save the action. | |
| 4722 DCHECK(!has_saved_context_menu_action_); | |
| 4723 has_saved_context_menu_action_ = true; | |
|
brettw
2011/01/29 00:56:52
It would be nice if this was on the PepperPluginDe
viettrungluu
2011/01/29 21:49:14
Done. I just have the RenderView bounce things ove
| |
| 4724 saved_context_menu_action_ = action; | |
| 4725 } else { | |
| 4726 webview()->performCustomContextMenuAction(action); | |
| 4727 } | |
| 4717 } | 4728 } |
| 4718 | 4729 |
| 4719 void RenderView::OnTranslatePage(int page_id, | 4730 void RenderView::OnTranslatePage(int page_id, |
| 4720 const std::string& translate_script, | 4731 const std::string& translate_script, |
| 4721 const std::string& source_lang, | 4732 const std::string& source_lang, |
| 4722 const std::string& target_lang) { | 4733 const std::string& target_lang) { |
| 4723 translate_helper_.TranslatePage(page_id, source_lang, target_lang, | 4734 translate_helper_.TranslatePage(page_id, source_lang, target_lang, |
| 4724 translate_script); | 4735 translate_script); |
| 4725 } | 4736 } |
| 4726 | 4737 |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5763 #endif | 5774 #endif |
| 5764 | 5775 |
| 5765 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { | 5776 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
| 5766 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5777 if (cmd == kJavaScriptStressTestSetStressRunType) { |
| 5767 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5778 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
| 5768 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5779 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
| 5769 v8::Testing::PrepareStressRun(param); | 5780 v8::Testing::PrepareStressRun(param); |
| 5770 } | 5781 } |
| 5771 } | 5782 } |
| 5772 | 5783 |
| 5773 void RenderView::OnContextMenuClosed() { | 5784 void RenderView::OnContextMenuClosed( |
| 5774 context_menu_node_.reset(); | 5785 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5786 if (custom_context.is_pepper_menu) { | |
| 5787 pepper_delegate_.CompleteShowContextMenu(custom_context.request_id, | |
| 5788 has_saved_context_menu_action_, | |
| 5789 saved_context_menu_action_); | |
| 5790 has_saved_context_menu_action_ = false; | |
| 5791 saved_context_menu_action_ = 0; | |
| 5792 } else { | |
| 5793 context_menu_node_.reset(); | |
| 5794 } | |
| 5775 } | 5795 } |
| OLD | NEW |