| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 |
| (...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 | 2225 |
| 2226 void RenderView::UserMetricsRecordAction(const std::wstring& action) { | 2226 void RenderView::UserMetricsRecordAction(const std::wstring& action) { |
| 2227 Send(new ViewHostMsg_UserMetricsRecordAction(routing_id_, action)); | 2227 Send(new ViewHostMsg_UserMetricsRecordAction(routing_id_, action)); |
| 2228 } | 2228 } |
| 2229 | 2229 |
| 2230 void RenderView::DnsPrefetch(const std::vector<std::string>& host_names) { | 2230 void RenderView::DnsPrefetch(const std::vector<std::string>& host_names) { |
| 2231 Send(new ViewHostMsg_DnsPrefetch(host_names)); | 2231 Send(new ViewHostMsg_DnsPrefetch(host_names)); |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 void RenderView::OnZoom(int function) { | 2234 void RenderView::OnZoom(int function) { |
| 2235 static const bool kZoomIsTextOnly = false; | |
| 2236 switch (function) { | 2235 switch (function) { |
| 2236 case PageZoom::TEXT_ONLY_SMALLER: |
| 2237 webview()->ZoomOut(true); |
| 2238 break; |
| 2237 case PageZoom::SMALLER: | 2239 case PageZoom::SMALLER: |
| 2238 webview()->ZoomOut(kZoomIsTextOnly); | 2240 webview()->ZoomOut(false); |
| 2239 break; | 2241 break; |
| 2240 case PageZoom::STANDARD: | 2242 case PageZoom::STANDARD: |
| 2241 webview()->ResetZoom(); | 2243 webview()->ResetZoom(); |
| 2242 break; | 2244 break; |
| 2243 case PageZoom::LARGER: | 2245 case PageZoom::LARGER: |
| 2244 webview()->ZoomIn(kZoomIsTextOnly); | 2246 webview()->ZoomIn(false); |
| 2247 break; |
| 2248 case PageZoom::TEXT_ONLY_LARGER: |
| 2249 webview()->ZoomIn(true); |
| 2245 break; | 2250 break; |
| 2246 default: | 2251 default: |
| 2247 NOTREACHED(); | 2252 NOTREACHED(); |
| 2248 } | 2253 } |
| 2249 } | 2254 } |
| 2250 | 2255 |
| 2251 void RenderView::OnInsertText(const string16& text) { | 2256 void RenderView::OnInsertText(const string16& text) { |
| 2252 WebFrame* frame = webview()->GetFocusedFrame(); | 2257 WebFrame* frame = webview()->GetFocusedFrame(); |
| 2253 if (!frame) | 2258 if (!frame) |
| 2254 return; | 2259 return; |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2839 scoped_ptr<PasswordForm> password_form( | 2844 scoped_ptr<PasswordForm> password_form( |
| 2840 PasswordFormDomManager::CreatePasswordForm(form)); | 2845 PasswordFormDomManager::CreatePasswordForm(form)); |
| 2841 if (password_form.get()) | 2846 if (password_form.get()) |
| 2842 password_forms.push_back(*password_form); | 2847 password_forms.push_back(*password_form); |
| 2843 } | 2848 } |
| 2844 } | 2849 } |
| 2845 | 2850 |
| 2846 if (!password_forms.empty()) | 2851 if (!password_forms.empty()) |
| 2847 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 2852 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
| 2848 } | 2853 } |
| OLD | NEW |