Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11418295: Use WebCore:DateTimeChooser for date/time form types instead of considering them text fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bind.h" 10 #include "base/bind.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #include "content/renderer/notification_provider.h" 90 #include "content/renderer/notification_provider.h"
91 #include "content/renderer/plugin_channel_host.h" 91 #include "content/renderer/plugin_channel_host.h"
92 #include "content/renderer/render_process.h" 92 #include "content/renderer/render_process.h"
93 #include "content/renderer/render_thread_impl.h" 93 #include "content/renderer/render_thread_impl.h"
94 #include "content/renderer/render_view_impl_params.h" 94 #include "content/renderer/render_view_impl_params.h"
95 #include "content/renderer/render_view_mouse_lock_dispatcher.h" 95 #include "content/renderer/render_view_mouse_lock_dispatcher.h"
96 #include "content/renderer/render_widget_fullscreen_pepper.h" 96 #include "content/renderer/render_widget_fullscreen_pepper.h"
97 #include "content/renderer/renderer_accessibility.h" 97 #include "content/renderer/renderer_accessibility.h"
98 #include "content/renderer/renderer_accessibility_complete.h" 98 #include "content/renderer/renderer_accessibility_complete.h"
99 #include "content/renderer/renderer_accessibility_focus_only.h" 99 #include "content/renderer/renderer_accessibility_focus_only.h"
100 #include "content/renderer/renderer_date_time_picker.h"
100 #include "content/renderer/renderer_webapplicationcachehost_impl.h" 101 #include "content/renderer/renderer_webapplicationcachehost_impl.h"
101 #include "content/renderer/renderer_webcolorchooser_impl.h" 102 #include "content/renderer/renderer_webcolorchooser_impl.h"
102 #include "content/renderer/speech_recognition_dispatcher.h" 103 #include "content/renderer/speech_recognition_dispatcher.h"
103 #include "content/renderer/text_input_client_observer.h" 104 #include "content/renderer/text_input_client_observer.h"
104 #include "content/renderer/v8_value_converter_impl.h" 105 #include "content/renderer/v8_value_converter_impl.h"
105 #include "content/renderer/web_intents_host.h" 106 #include "content/renderer/web_intents_host.h"
106 #include "content/renderer/web_ui_extension.h" 107 #include "content/renderer/web_ui_extension.h"
107 #include "content/renderer/web_ui_extension_data.h" 108 #include "content/renderer/web_ui_extension_data.h"
108 #include "content/renderer/webplugin_delegate_proxy.h" 109 #include "content/renderer/webplugin_delegate_proxy.h"
109 #include "content/renderer/websharedworker_proxy.h" 110 #include "content/renderer/websharedworker_proxy.h"
110 #include "media/base/filter_collection.h" 111 #include "media/base/filter_collection.h"
111 #include "media/base/media_switches.h" 112 #include "media/base/media_switches.h"
112 #include "media/base/message_loop_factory.h" 113 #include "media/base/message_loop_factory.h"
113 #include "media/filters/audio_renderer_impl.h" 114 #include "media/filters/audio_renderer_impl.h"
114 #include "media/filters/gpu_video_decoder.h" 115 #include "media/filters/gpu_video_decoder.h"
115 #include "net/base/data_url.h" 116 #include "net/base/data_url.h"
116 #include "net/base/escape.h" 117 #include "net/base/escape.h"
117 #include "net/base/net_errors.h" 118 #include "net/base/net_errors.h"
118 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 119 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
119 #include "net/http/http_util.h" 120 #include "net/http/http_util.h"
120 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" 121 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h"
121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h"
122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h"
124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h"
125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDateTimeChooserCom pletion.h"
128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDateTimeChooserPar ams.h"
126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h"
129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h"
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h"
132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h"
133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h" 137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h"
135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" 138 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h"
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) 917 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame)
915 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) 918 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
916 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) 919 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo)
917 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) 920 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut)
918 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) 921 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy)
919 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) 922 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste)
920 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 923 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
921 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) 924 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace)
922 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) 925 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
923 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) 926 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
924 IPC_MESSAGE_HANDLER(ViewMsg_ReplaceAll, OnReplaceAll)
925 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect) 927 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect)
926 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets, 928 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets,
927 OnSetEditableSelectionOffsets) 929 OnSetEditableSelectionOffsets)
928 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText, 930 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText,
929 OnSetCompositionFromExistingText) 931 OnSetCompositionFromExistingText)
930 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete, 932 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete,
931 OnExtendSelectionAndDelete) 933 OnExtendSelectionAndDelete)
932 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange) 934 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange)
933 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 935 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
934 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteEditCommand, OnExecuteEditCommand) 936 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteEditCommand, OnExecuteEditCommand)
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 } 1336 }
1335 1337
1336 void RenderViewImpl::OnSelectAll() { 1338 void RenderViewImpl::OnSelectAll() {
1337 if (!webview()) 1339 if (!webview())
1338 return; 1340 return;
1339 1341
1340 webview()->focusedFrame()->executeCommand( 1342 webview()->focusedFrame()->executeCommand(
1341 WebString::fromUTF8("SelectAll")); 1343 WebString::fromUTF8("SelectAll"));
1342 } 1344 }
1343 1345
1344 void RenderViewImpl::OnReplaceAll(const string16& text) {
1345 WebNode node = GetFocusedNode();
1346 if (node.isNull() || !IsEditableNode(node))
1347 return;
1348
1349 OnSelectAll();
1350 OnReplace(text);
1351 }
1352
1353 void RenderViewImpl::OnUnselect() { 1346 void RenderViewImpl::OnUnselect() {
1354 if (!webview()) 1347 if (!webview())
1355 return; 1348 return;
1356 1349
1357 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); 1350 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect"));
1358 } 1351 }
1359 1352
1360 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { 1353 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) {
1361 webview()->setEditableSelectionOffsets(start, end); 1354 webview()->setEditableSelectionOffsets(start, end);
1362 } 1355 }
(...skipping 4912 matching lines...) Expand 10 before | Expand all | Expand 10 after
6275 size_t request_id) { 6268 size_t request_id) {
6276 if (request_id != expected_content_intent_id_) 6269 if (request_id != expected_content_intent_id_)
6277 return; 6270 return;
6278 6271
6279 // Remove the content highlighting if any. 6272 // Remove the content highlighting if any.
6280 scheduleComposite(); 6273 scheduleComposite();
6281 6274
6282 if (!intent.is_empty()) 6275 if (!intent.is_empty())
6283 Send(new ViewHostMsg_StartContentIntent(routing_id_, intent)); 6276 Send(new ViewHostMsg_StartContentIntent(routing_id_, intent));
6284 } 6277 }
6278
6279 bool RenderViewImpl::openDateTimeChooser(
6280 const WebKit::WebDateTimeChooserParams& params,
6281 WebKit::WebDateTimeChooserCompletion* completion) {
6282 date_time_picker_client_.reset(
6283 new RendererDateTimePicker(this, params, completion));
6284 return date_time_picker_client_->Open();
6285 }
6286
6285 #endif 6287 #endif
6286 6288
6287 void RenderViewImpl::OnAsyncFileOpened( 6289 void RenderViewImpl::OnAsyncFileOpened(
6288 base::PlatformFileError error_code, 6290 base::PlatformFileError error_code,
6289 IPC::PlatformFileForTransit file_for_transit, 6291 IPC::PlatformFileForTransit file_for_transit,
6290 int message_id) { 6292 int message_id) {
6291 pepper_delegate_.OnAsyncFileOpened( 6293 pepper_delegate_.OnAsyncFileOpened(
6292 error_code, 6294 error_code,
6293 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 6295 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
6294 message_id); 6296 message_id);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
6438 } 6440 }
6439 #endif 6441 #endif
6440 6442
6441 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6443 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6442 TransportDIB::Handle dib_handle) { 6444 TransportDIB::Handle dib_handle) {
6443 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6445 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6444 RenderProcess::current()->ReleaseTransportDIB(dib); 6446 RenderProcess::current()->ReleaseTransportDIB(dib);
6445 } 6447 }
6446 6448
6447 } // namespace content 6449 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698