| 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/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 void RenderViewHost::MultiFilesSelected( | 681 void RenderViewHost::MultiFilesSelected( |
| 682 const std::vector<FilePath>& files) { | 682 const std::vector<FilePath>& files) { |
| 683 for (std::vector<FilePath>::const_iterator file = files.begin(); | 683 for (std::vector<FilePath>::const_iterator file = files.begin(); |
| 684 file != files.end(); ++file) { | 684 file != files.end(); ++file) { |
| 685 ChildProcessSecurityPolicy::GetInstance()->GrantUploadFile( | 685 ChildProcessSecurityPolicy::GetInstance()->GrantUploadFile( |
| 686 process()->pid(), *file); | 686 process()->pid(), *file); |
| 687 } | 687 } |
| 688 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files)); | 688 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files)); |
| 689 } | 689 } |
| 690 | 690 |
| 691 void RenderViewHost::GeolocationProviderChosen( |
| 692 WebCore::GeolocationPowerbox::ProviderId provider_id) { |
| 693 Send(new ViewMsg_ChooseGeolocationProviderResponse(routing_id(), |
| 694 provider_id)); |
| 695 } |
| 696 |
| 691 void RenderViewHost::LoadStateChanged(const GURL& url, | 697 void RenderViewHost::LoadStateChanged(const GURL& url, |
| 692 net::LoadState load_state) { | 698 net::LoadState load_state) { |
| 693 delegate_->LoadStateChanged(url, load_state); | 699 delegate_->LoadStateChanged(url, load_state); |
| 694 } | 700 } |
| 695 | 701 |
| 696 bool RenderViewHost::SuddenTerminationAllowed() const { | 702 bool RenderViewHost::SuddenTerminationAllowed() const { |
| 697 return sudden_termination_allowed_ || process()->sudden_termination_allowed(); | 703 return sudden_termination_allowed_ || process()->sudden_termination_allowed(); |
| 698 } | 704 } |
| 699 | 705 |
| 700 /////////////////////////////////////////////////////////////////////////////// | 706 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 IPC_MESSAGE_HANDLER(ViewHostMsg_DOMUISend, | 766 IPC_MESSAGE_HANDLER(ViewHostMsg_DOMUISend, |
| 761 OnMsgDOMUISend) | 767 OnMsgDOMUISend) |
| 762 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardMessageToExternalHost, | 768 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardMessageToExternalHost, |
| 763 OnMsgForwardMessageToExternalHost) | 769 OnMsgForwardMessageToExternalHost) |
| 764 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, | 770 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, |
| 765 OnMsgDocumentLoadedInFrame) | 771 OnMsgDocumentLoadedInFrame) |
| 766 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, | 772 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, |
| 767 OnMsgGoToEntryAtOffset) | 773 OnMsgGoToEntryAtOffset) |
| 768 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText) | 774 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText) |
| 769 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnMsgRunFileChooser) | 775 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnMsgRunFileChooser) |
| 776 IPC_MESSAGE_HANDLER(ViewHostMsg_ChooseGeolocationProvider, |
| 777 OnMsgChooseGeolocationProvider) |
| 770 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 778 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
| 771 OnMsgRunJavaScriptMessage) | 779 OnMsgRunJavaScriptMessage) |
| 772 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 780 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
| 773 OnMsgRunBeforeUnloadConfirm) | 781 OnMsgRunBeforeUnloadConfirm) |
| 774 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog, | 782 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog, |
| 775 OnMsgShowModalHTMLDialog) | 783 OnMsgShowModalHTMLDialog) |
| 776 IPC_MESSAGE_HANDLER(ViewHostMsg_PasswordFormsSeen, OnMsgPasswordFormsSeen) | 784 IPC_MESSAGE_HANDLER(ViewHostMsg_PasswordFormsSeen, OnMsgPasswordFormsSeen) |
| 777 IPC_MESSAGE_HANDLER(ViewHostMsg_AutofillFormSubmitted, | 785 IPC_MESSAGE_HANDLER(ViewHostMsg_AutofillFormSubmitted, |
| 778 OnMsgAutofillFormSubmitted) | 786 OnMsgAutofillFormSubmitted) |
| 779 IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging) | 787 IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging) |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 if (view()) | 1265 if (view()) |
| 1258 view()->PasteFromSelectionClipboard(); | 1266 view()->PasteFromSelectionClipboard(); |
| 1259 } | 1267 } |
| 1260 | 1268 |
| 1261 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, | 1269 void RenderViewHost::OnMsgRunFileChooser(bool multiple_files, |
| 1262 const string16& title, | 1270 const string16& title, |
| 1263 const FilePath& default_file) { | 1271 const FilePath& default_file) { |
| 1264 delegate_->RunFileChooser(multiple_files, title, default_file); | 1272 delegate_->RunFileChooser(multiple_files, title, default_file); |
| 1265 } | 1273 } |
| 1266 | 1274 |
| 1275 void RenderViewHost::OnMsgChooseGeolocationProvider(const GURL &url) { |
| 1276 LOG(WARNING) << "Ready to render!"; |
| 1277 delegate_->ChooseGeolocationProvider(url); |
| 1278 } |
| 1279 |
| 1267 void RenderViewHost::OnMsgRunJavaScriptMessage( | 1280 void RenderViewHost::OnMsgRunJavaScriptMessage( |
| 1268 const std::wstring& message, | 1281 const std::wstring& message, |
| 1269 const std::wstring& default_prompt, | 1282 const std::wstring& default_prompt, |
| 1270 const GURL& frame_url, | 1283 const GURL& frame_url, |
| 1271 const int flags, | 1284 const int flags, |
| 1272 IPC::Message* reply_msg) { | 1285 IPC::Message* reply_msg) { |
| 1273 // While a JS message dialog is showing, tabs in the same process shouldn't | 1286 // While a JS message dialog is showing, tabs in the same process shouldn't |
| 1274 // process input events. | 1287 // process input events. |
| 1275 process()->set_ignore_input_events(true); | 1288 process()->set_ignore_input_events(true); |
| 1276 StopHangMonitorTimeout(); | 1289 StopHangMonitorTimeout(); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 } | 1653 } |
| 1641 | 1654 |
| 1642 void RenderViewHost::ResetModalDialogEvent() { | 1655 void RenderViewHost::ResetModalDialogEvent() { |
| 1643 if (--modal_dialog_count_ == 0) | 1656 if (--modal_dialog_count_ == 0) |
| 1644 modal_dialog_event_->Reset(); | 1657 modal_dialog_event_->Reset(); |
| 1645 } | 1658 } |
| 1646 | 1659 |
| 1647 void RenderViewHost::UpdateBrowserWindowId(int window_id) { | 1660 void RenderViewHost::UpdateBrowserWindowId(int window_id) { |
| 1648 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); | 1661 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); |
| 1649 } | 1662 } |
| OLD | NEW |