| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 opened_by_user_gesture_(true), | 640 opened_by_user_gesture_(true), |
| 641 opener_suppressed_(false), | 641 opener_suppressed_(false), |
| 642 suppress_dialogs_until_swap_out_(false), | 642 suppress_dialogs_until_swap_out_(false), |
| 643 page_id_(-1), | 643 page_id_(-1), |
| 644 last_page_id_sent_to_browser_(-1), | 644 last_page_id_sent_to_browser_(-1), |
| 645 next_page_id_(params->next_page_id), | 645 next_page_id_(params->next_page_id), |
| 646 history_list_offset_(-1), | 646 history_list_offset_(-1), |
| 647 history_list_length_(0), | 647 history_list_length_(0), |
| 648 frames_in_progress_(0), | 648 frames_in_progress_(0), |
| 649 target_url_status_(TARGET_NONE), | 649 target_url_status_(TARGET_NONE), |
| 650 uses_temporary_zoom_level_(false), |
| 650 #if defined(OS_ANDROID) | 651 #if defined(OS_ANDROID) |
| 651 top_controls_constraints_(cc::BOTH), | 652 top_controls_constraints_(cc::BOTH), |
| 652 #endif | 653 #endif |
| 653 has_scrolled_focused_editable_node_into_rect_(false), | 654 has_scrolled_focused_editable_node_into_rect_(false), |
| 654 push_messaging_dispatcher_(NULL), | 655 push_messaging_dispatcher_(NULL), |
| 655 speech_recognition_dispatcher_(NULL), | 656 speech_recognition_dispatcher_(NULL), |
| 656 media_stream_dispatcher_(NULL), | 657 media_stream_dispatcher_(NULL), |
| 657 browser_plugin_manager_(NULL), | 658 browser_plugin_manager_(NULL), |
| 658 midi_dispatcher_(NULL), | 659 midi_dispatcher_(NULL), |
| 659 devtools_agent_(NULL), | 660 devtools_agent_(NULL), |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 OnSetEditCommandsForNextKeyEvent) | 1071 OnSetEditCommandsForNextKeyEvent) |
| 1071 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 1072 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
| 1072 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | 1073 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) |
| 1073 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1074 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
| 1074 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1075 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
| 1075 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1076 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
| 1076 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1077 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
| 1077 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1078 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 1078 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1079 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| 1079 OnSetZoomLevelForLoadingURL) | 1080 OnSetZoomLevelForLoadingURL) |
| 1081 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
| 1082 OnSetZoomLevelForView) |
| 1080 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 1083 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
| 1081 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, | 1084 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault, |
| 1082 OnResetPageEncodingToDefault) | 1085 OnResetPageEncodingToDefault) |
| 1083 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) | 1086 IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent) |
| 1084 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) | 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) |
| 1085 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) | 1088 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) |
| 1086 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) | 1089 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) |
| 1087 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) | 1090 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) |
| 1088 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) | 1091 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) |
| 1089 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, | 1092 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2633 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, | 2636 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url, |
| 2634 double zoom_level) { | 2637 double zoom_level) { |
| 2635 #if !defined(OS_ANDROID) | 2638 #if !defined(OS_ANDROID) |
| 2636 // On Android, page zoom isn't used, and in case of WebView, text zoom is used | 2639 // On Android, page zoom isn't used, and in case of WebView, text zoom is used |
| 2637 // for legacy WebView text scaling emulation. Thus, the code that resets | 2640 // for legacy WebView text scaling emulation. Thus, the code that resets |
| 2638 // the zoom level from this map will be effectively resetting text zoom level. | 2641 // the zoom level from this map will be effectively resetting text zoom level. |
| 2639 host_zoom_levels_[url] = zoom_level; | 2642 host_zoom_levels_[url] = zoom_level; |
| 2640 #endif | 2643 #endif |
| 2641 } | 2644 } |
| 2642 | 2645 |
| 2646 void RenderViewImpl::OnSetZoomLevelForView(bool uses_temporary_zoom_level, |
| 2647 double level) { |
| 2648 uses_temporary_zoom_level_ = uses_temporary_zoom_level; |
| 2649 |
| 2650 webview()->hidePopups(); |
| 2651 webview()->setZoomLevel(level); |
| 2652 } |
| 2653 |
| 2643 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { | 2654 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { |
| 2644 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); | 2655 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| 2645 } | 2656 } |
| 2646 | 2657 |
| 2647 void RenderViewImpl::OnResetPageEncodingToDefault() { | 2658 void RenderViewImpl::OnResetPageEncodingToDefault() { |
| 2648 WebString no_encoding; | 2659 WebString no_encoding; |
| 2649 webview()->setPageEncoding(no_encoding); | 2660 webview()->setPageEncoding(no_encoding); |
| 2650 } | 2661 } |
| 2651 | 2662 |
| 2652 void RenderViewImpl::OnPostMessageEvent( | 2663 void RenderViewImpl::OnPostMessageEvent( |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4038 std::vector<gfx::Size> sizes; | 4049 std::vector<gfx::Size> sizes; |
| 4039 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4050 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4040 if (!url.isEmpty()) | 4051 if (!url.isEmpty()) |
| 4041 urls.push_back( | 4052 urls.push_back( |
| 4042 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4053 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4043 } | 4054 } |
| 4044 SendUpdateFaviconURL(urls); | 4055 SendUpdateFaviconURL(urls); |
| 4045 } | 4056 } |
| 4046 | 4057 |
| 4047 } // namespace content | 4058 } // namespace content |
| OLD | NEW |