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 4698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4709 | 4709 |
4710 void RenderView::OnUpdateWebPreferences(const WebPreferences& prefs) { | 4710 void RenderView::OnUpdateWebPreferences(const WebPreferences& prefs) { |
4711 webkit_preferences_ = prefs; | 4711 webkit_preferences_ = prefs; |
4712 webkit_preferences_.Apply(webview()); | 4712 webkit_preferences_.Apply(webview()); |
4713 } | 4713 } |
4714 | 4714 |
4715 void RenderView::OnSetAltErrorPageURL(const GURL& url) { | 4715 void RenderView::OnSetAltErrorPageURL(const GURL& url) { |
4716 alternate_error_page_url_ = url; | 4716 alternate_error_page_url_ = url; |
4717 } | 4717 } |
4718 | 4718 |
4719 void RenderView::OnCustomContextMenuAction(unsigned action) { | 4719 void RenderView::OnCustomContextMenuAction( |
4720 webview()->performCustomContextMenuAction(action); | 4720 const webkit_glue::CustomContextMenuContext& custom_context, |
| 4721 unsigned action) { |
| 4722 if (custom_context.is_pepper_menu) |
| 4723 pepper_delegate_.OnCustomContextMenuAction(custom_context, action); |
| 4724 else |
| 4725 webview()->performCustomContextMenuAction(action); |
4721 } | 4726 } |
4722 | 4727 |
4723 void RenderView::OnTranslatePage(int page_id, | 4728 void RenderView::OnTranslatePage(int page_id, |
4724 const std::string& translate_script, | 4729 const std::string& translate_script, |
4725 const std::string& source_lang, | 4730 const std::string& source_lang, |
4726 const std::string& target_lang) { | 4731 const std::string& target_lang) { |
4727 translate_helper_.TranslatePage(page_id, source_lang, target_lang, | 4732 translate_helper_.TranslatePage(page_id, source_lang, target_lang, |
4728 translate_script); | 4733 translate_script); |
4729 } | 4734 } |
4730 | 4735 |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5767 #endif | 5772 #endif |
5768 | 5773 |
5769 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { | 5774 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
5770 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5775 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5771 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5776 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5772 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5777 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5773 v8::Testing::PrepareStressRun(param); | 5778 v8::Testing::PrepareStressRun(param); |
5774 } | 5779 } |
5775 } | 5780 } |
5776 | 5781 |
5777 void RenderView::OnContextMenuClosed() { | 5782 void RenderView::OnContextMenuClosed( |
5778 context_menu_node_.reset(); | 5783 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5784 if (custom_context.is_pepper_menu) |
| 5785 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 5786 else |
| 5787 context_menu_node_.reset(); |
5779 } | 5788 } |
OLD | NEW |