OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/gfx/png_encoder.h" | 12 #include "base/gfx/png_encoder.h" |
13 #include "base/gfx/native_widget_types.h" | 13 #include "base/gfx/native_widget_types.h" |
14 #include "base/string_piece.h" | 14 #include "base/string_piece.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/app/theme/theme_resources.h" | 17 #include "chrome/app/theme/theme_resources.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/gfx/favicon_size.h" | 19 #include "chrome/common/gfx/favicon_size.h" |
20 #include "chrome/common/gfx/color_utils.h" | 20 #include "chrome/common/gfx/color_utils.h" |
21 #include "chrome/common/jstemplate_builder.h" | 21 #include "chrome/common/jstemplate_builder.h" |
22 #include "chrome/common/l10n_util.h" | 22 #include "chrome/common/l10n_util.h" |
23 #include "chrome/common/page_zoom.h" | 23 #include "chrome/common/page_zoom.h" |
| 24 #include "chrome/common/render_messages.h" |
24 #include "chrome/common/resource_bundle.h" | 25 #include "chrome/common/resource_bundle.h" |
25 #include "chrome/common/thumbnail_score.h" | 26 #include "chrome/common/thumbnail_score.h" |
26 #include "chrome/renderer/about_handler.h" | 27 #include "chrome/renderer/about_handler.h" |
27 #include "chrome/renderer/debug_message_handler.h" | 28 #include "chrome/renderer/debug_message_handler.h" |
28 #include "chrome/renderer/localized_error.h" | 29 #include "chrome/renderer/localized_error.h" |
29 #include "chrome/renderer/renderer_resources.h" | 30 #include "chrome/renderer/renderer_resources.h" |
30 #include "chrome/renderer/user_script_slave.h" | 31 #include "chrome/renderer/user_script_slave.h" |
31 #include "chrome/renderer/visitedlink_slave.h" | 32 #include "chrome/renderer/visitedlink_slave.h" |
32 #include "chrome/renderer/webmediaplayer_delegate_impl.h" | 33 #include "chrome/renderer/webmediaplayer_delegate_impl.h" |
33 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 int x, | 2006 int x, |
2006 int y, | 2007 int y, |
2007 const GURL& link_url, | 2008 const GURL& link_url, |
2008 const GURL& image_url, | 2009 const GURL& image_url, |
2009 const GURL& page_url, | 2010 const GURL& page_url, |
2010 const GURL& frame_url, | 2011 const GURL& frame_url, |
2011 const std::wstring& selection_text, | 2012 const std::wstring& selection_text, |
2012 const std::wstring& misspelled_word, | 2013 const std::wstring& misspelled_word, |
2013 int edit_flags, | 2014 int edit_flags, |
2014 const std::string& security_info) { | 2015 const std::string& security_info) { |
2015 ViewHostMsg_ContextMenu_Params params; | 2016 ContextMenuParams params; |
2016 params.node = node; | 2017 params.node = node; |
2017 params.x = x; | 2018 params.x = x; |
2018 params.y = y; | 2019 params.y = y; |
2019 params.image_url = image_url; | 2020 params.image_url = image_url; |
2020 params.link_url = link_url; | 2021 params.link_url = link_url; |
2021 params.page_url = page_url; | 2022 params.page_url = page_url; |
2022 params.frame_url = frame_url; | 2023 params.frame_url = frame_url; |
2023 params.selection_text = selection_text; | 2024 params.selection_text = selection_text; |
2024 params.misspelled_word = misspelled_word; | 2025 params.misspelled_word = misspelled_word; |
2025 params.spellcheck_enabled = | 2026 params.spellcheck_enabled = |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 main_frame->SetInViewSourceMode(true); | 2661 main_frame->SetInViewSourceMode(true); |
2661 } | 2662 } |
2662 | 2663 |
2663 void RenderView::OnUpdateBackForwardListCount(int back_list_count, | 2664 void RenderView::OnUpdateBackForwardListCount(int back_list_count, |
2664 int forward_list_count) { | 2665 int forward_list_count) { |
2665 history_back_list_count_ = back_list_count; | 2666 history_back_list_count_ = back_list_count; |
2666 history_forward_list_count_ = forward_list_count; | 2667 history_forward_list_count_ = forward_list_count; |
2667 } | 2668 } |
2668 | 2669 |
2669 void RenderView::OnGetAccessibilityInfo( | 2670 void RenderView::OnGetAccessibilityInfo( |
2670 const ViewMsg_Accessibility_In_Params& in_params, | 2671 const AccessibilityInParams& in_params, |
2671 ViewHostMsg_Accessibility_Out_Params* out_params) { | 2672 AccessibilityOutParams* out_params) { |
2672 #if defined(OS_WIN) | 2673 #if defined(OS_WIN) |
2673 if (!glue_accessibility_.get()) | 2674 if (!glue_accessibility_.get()) |
2674 glue_accessibility_.reset(new GlueAccessibility()); | 2675 glue_accessibility_.reset(new GlueAccessibility()); |
2675 | 2676 |
2676 if (!glue_accessibility_-> | 2677 if (!glue_accessibility_-> |
2677 GetAccessibilityInfo(webview(), in_params, out_params)) { | 2678 GetAccessibilityInfo(webview(), in_params, out_params)) { |
2678 return; | 2679 return; |
2679 } | 2680 } |
2680 #else // defined(OS_WIN) | 2681 #else // defined(OS_WIN) |
2681 // TODO(port): accessibility not yet implemented | 2682 // TODO(port): accessibility not yet implemented |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 template_resource_id)); | 2853 template_resource_id)); |
2853 | 2854 |
2854 if (template_html.empty()) { | 2855 if (template_html.empty()) { |
2855 NOTREACHED() << "unable to load template. ID: " << template_resource_id; | 2856 NOTREACHED() << "unable to load template. ID: " << template_resource_id; |
2856 return ""; | 2857 return ""; |
2857 } | 2858 } |
2858 // "t" is the id of the templates root node. | 2859 // "t" is the id of the templates root node. |
2859 return jstemplate_builder::GetTemplateHtml( | 2860 return jstemplate_builder::GetTemplateHtml( |
2860 template_html, &error_strings, "t"); | 2861 template_html, &error_strings, "t"); |
2861 } | 2862 } |
OLD | NEW |