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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 497001: Add runFileChooser() with selected filenames and acceptable types parameters.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Switch to runFileChooser() with WebFileChooserParams.... Created 10 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // TODO(port): The compact language detection library works only for Windows. 69 // TODO(port): The compact language detection library works only for Windows.
70 #include "third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cl d_unicodetext.h" 70 #include "third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cl d_unicodetext.h"
71 #endif 71 #endif
72 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" 72 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h"
73 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" 73 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h"
74 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" 74 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h"
75 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" 75 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h"
76 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" 76 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h"
77 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" 77 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
78 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" 78 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h"
79 #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserParams.h"
79 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" 80 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h"
80 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" 81 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
81 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" 82 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h"
82 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" 83 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h"
83 #include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h" 84 #include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h"
84 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializer.h" 85 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializer.h"
85 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" 86 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h"
86 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h" 87 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h"
87 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" 88 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
88 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" 89 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h"
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 bool RenderView::isShowingSpellingUI() { 1583 bool RenderView::isShowingSpellingUI() {
1583 return spelling_panel_visible_; 1584 return spelling_panel_visible_;
1584 } 1585 }
1585 1586
1586 void RenderView::updateSpellingUIWithMisspelledWord(const WebString& word) { 1587 void RenderView::updateSpellingUIWithMisspelledWord(const WebString& word) {
1587 Send(new ViewHostMsg_UpdateSpellingPanelWithMisspelledWord(routing_id_, 1588 Send(new ViewHostMsg_UpdateSpellingPanelWithMisspelledWord(routing_id_,
1588 word)); 1589 word));
1589 } 1590 }
1590 1591
1591 bool RenderView::runFileChooser( 1592 bool RenderView::runFileChooser(
1592 bool multi_select, 1593 const WebKit::WebFileChooserParams& params,
1593 const WebKit::WebString& title,
1594 const WebKit::WebString& initial_value,
1595 WebKit::WebFileChooserCompletion* chooser_completion) { 1594 WebKit::WebFileChooserCompletion* chooser_completion) {
1596 if (file_chooser_completion_) { 1595 if (file_chooser_completion_) {
1597 // TODO(brettw): bug 1235154: This should be a synchronous message to deal 1596 // TODO(brettw): bug 1235154: This should be a synchronous message to deal
1598 // with the fact that web pages can programatically trigger this. With the 1597 // with the fact that web pages can programatically trigger this. With the
1599 // asnychronous messages, we can get an additional call when one is pending, 1598 // asnychronous messages, we can get an additional call when one is pending,
1600 // which this test is for. For now, we just ignore the additional file 1599 // which this test is for. For now, we just ignore the additional file
1601 // chooser request. WebKit doesn't do anything to expect the callback, so 1600 // chooser request. WebKit doesn't do anything to expect the callback, so
1602 // we can just ignore calling it. 1601 // we can just ignore calling it.
1603 return false; 1602 return false;
1604 } 1603 }
1605 file_chooser_completion_ = chooser_completion; 1604 file_chooser_completion_ = chooser_completion;
1606 Send(new ViewHostMsg_RunFileChooser( 1605 Send(new ViewHostMsg_RunFileChooser(
1607 routing_id_, multi_select, title, 1606 routing_id_, params.multiSelect, params.title,
1608 webkit_glue::WebStringToFilePath(initial_value))); 1607 webkit_glue::WebStringToFilePath(params.initialValue)));
1609 return true; 1608 return true;
1610 } 1609 }
1611 1610
1612 void RenderView::runModalAlertDialog( 1611 void RenderView::runModalAlertDialog(
1613 WebFrame* frame, const WebString& message) { 1612 WebFrame* frame, const WebString& message) {
1614 RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptAlert, 1613 RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptAlert,
1615 UTF16ToWideHack(message), 1614 UTF16ToWideHack(message),
1616 std::wstring(), 1615 std::wstring(),
1617 frame->url(), 1616 frame->url(),
1618 NULL); 1617 NULL);
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
4004 4003
4005 message->EnableMessagePumping(); // Runs a nested message loop. 4004 message->EnableMessagePumping(); // Runs a nested message loop.
4006 bool rv = Send(message); 4005 bool rv = Send(message);
4007 4006
4008 PluginChannelHost::Broadcast( 4007 PluginChannelHost::Broadcast(
4009 new PluginMsg_ResetModalDialogEvent(host_window_)); 4008 new PluginMsg_ResetModalDialogEvent(host_window_));
4010 4009
4011 return rv; 4010 return rv;
4012 } 4011 }
4013 4012
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698