| 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 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 12 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 13 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 13 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 14 #include "chrome/browser/renderer_host/render_widget_host.h" | 14 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 15 #include "chrome/common/modal_dialog_event.h" | 15 #include "chrome/common/modal_dialog_event.h" |
| 16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
| 17 #include "chrome/common/page_zoom.h" | 17 #include "chrome/common/page_zoom.h" |
| 18 #include "webkit/api/public/WebConsoleMessage.h" | 18 #include "webkit/api/public/WebConsoleMessage.h" |
| 19 #include "webkit/api/public/WebTextDirection.h" | 19 #include "webkit/api/public/WebTextDirection.h" |
| 20 #include "webkit/chaos/GeolocationPowerbox.h" |
| 20 #include "webkit/glue/autofill_form.h" | 21 #include "webkit/glue/autofill_form.h" |
| 21 #include "webkit/glue/password_form_dom_manager.h" | 22 #include "webkit/glue/password_form_dom_manager.h" |
| 22 #include "webkit/glue/window_open_disposition.h" | 23 #include "webkit/glue/window_open_disposition.h" |
| 23 | 24 |
| 24 class RenderViewHostDelegate; | 25 class RenderViewHostDelegate; |
| 25 class SiteInstance; | 26 class SiteInstance; |
| 26 class SkBitmap; | 27 class SkBitmap; |
| 27 class ViewMsg_Navigate; | 28 class ViewMsg_Navigate; |
| 28 struct ContextMenuParams; | 29 struct ContextMenuParams; |
| 29 struct MediaPlayerAction; | 30 struct MediaPlayerAction; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 const FilePath& local_directory_name); | 364 const FilePath& local_directory_name); |
| 364 | 365 |
| 365 // Notifies the RenderViewHost that a file has been chosen by the user from | 366 // Notifies the RenderViewHost that a file has been chosen by the user from |
| 366 // an Open File dialog for the form. | 367 // an Open File dialog for the form. |
| 367 void FileSelected(const FilePath& path); | 368 void FileSelected(const FilePath& path); |
| 368 | 369 |
| 369 // Notifies the Listener that many files have been chosen by the user from | 370 // Notifies the Listener that many files have been chosen by the user from |
| 370 // an Open File dialog for the form. | 371 // an Open File dialog for the form. |
| 371 void MultiFilesSelected(const std::vector<FilePath>& files); | 372 void MultiFilesSelected(const std::vector<FilePath>& files); |
| 372 | 373 |
| 374 void GeolocationProviderChosen( |
| 375 WebCore::GeolocationPowerbox::ProviderId provider_id); |
| 376 |
| 373 // Notifies the RenderViewHost that its load state changed. | 377 // Notifies the RenderViewHost that its load state changed. |
| 374 void LoadStateChanged(const GURL& url, net::LoadState load_state); | 378 void LoadStateChanged(const GURL& url, net::LoadState load_state); |
| 375 | 379 |
| 376 bool SuddenTerminationAllowed() const; | 380 bool SuddenTerminationAllowed() const; |
| 377 void set_sudden_termination_allowed(bool enabled) { | 381 void set_sudden_termination_allowed(bool enabled) { |
| 378 sudden_termination_allowed_ = enabled; | 382 sudden_termination_allowed_ = enabled; |
| 379 } | 383 } |
| 380 | 384 |
| 381 // Forward a message from external host to chrome renderer. | 385 // Forward a message from external host to chrome renderer. |
| 382 void ForwardMessageFromExternalHost(const std::string& message, | 386 void ForwardMessageFromExternalHost(const std::string& message, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 void SignalModalDialogEvent(); | 430 void SignalModalDialogEvent(); |
| 427 void ResetModalDialogEvent(); | 431 void ResetModalDialogEvent(); |
| 428 | 432 |
| 429 // Tell renderer which browser window it is being attached to. | 433 // Tell renderer which browser window it is being attached to. |
| 430 void UpdateBrowserWindowId(int window_id); | 434 void UpdateBrowserWindowId(int window_id); |
| 431 | 435 |
| 432 void set_in_inspect_element_mode(bool enabled) { | 436 void set_in_inspect_element_mode(bool enabled) { |
| 433 in_inspect_element_mode_ = enabled; | 437 in_inspect_element_mode_ = enabled; |
| 434 } | 438 } |
| 435 | 439 |
| 440 void ChooseGeolocationProvider(const GURL &url) { |
| 441 OnMsgChooseGeolocationProvider(url); |
| 442 } |
| 443 |
| 436 protected: | 444 protected: |
| 437 // RenderWidgetHost protected overrides. | 445 // RenderWidgetHost protected overrides. |
| 438 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); | 446 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 439 virtual void OnUserGesture(); | 447 virtual void OnUserGesture(); |
| 440 virtual void NotifyRendererUnresponsive(); | 448 virtual void NotifyRendererUnresponsive(); |
| 441 virtual void NotifyRendererResponsive(); | 449 virtual void NotifyRendererResponsive(); |
| 442 | 450 |
| 443 // IPC message handlers. | 451 // IPC message handlers. |
| 444 void OnMsgShowView(int route_id, | 452 void OnMsgShowView(int route_id, |
| 445 WindowOpenDisposition disposition, | 453 WindowOpenDisposition disposition, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 const std::string& target); | 509 const std::string& target); |
| 502 void OnMsgDocumentLoadedInFrame(); | 510 void OnMsgDocumentLoadedInFrame(); |
| 503 void OnMsgGoToEntryAtOffset(int offset); | 511 void OnMsgGoToEntryAtOffset(int offset); |
| 504 void OnMsgSetTooltipText(const std::wstring& tooltip_text, | 512 void OnMsgSetTooltipText(const std::wstring& tooltip_text, |
| 505 WebKit::WebTextDirection text_direction_hint); | 513 WebKit::WebTextDirection text_direction_hint); |
| 506 void OnMsgSelectionChanged(const std::string& text); | 514 void OnMsgSelectionChanged(const std::string& text); |
| 507 void OnMsgPasteFromSelectionClipboard(); | 515 void OnMsgPasteFromSelectionClipboard(); |
| 508 void OnMsgRunFileChooser(bool multiple_files, | 516 void OnMsgRunFileChooser(bool multiple_files, |
| 509 const string16& title, | 517 const string16& title, |
| 510 const FilePath& default_file); | 518 const FilePath& default_file); |
| 519 void OnMsgChooseGeolocationProvider(const GURL &url); |
| 511 void OnMsgRunJavaScriptMessage(const std::wstring& message, | 520 void OnMsgRunJavaScriptMessage(const std::wstring& message, |
| 512 const std::wstring& default_prompt, | 521 const std::wstring& default_prompt, |
| 513 const GURL& frame_url, | 522 const GURL& frame_url, |
| 514 const int flags, | 523 const int flags, |
| 515 IPC::Message* reply_msg); | 524 IPC::Message* reply_msg); |
| 516 void OnMsgRunBeforeUnloadConfirm(const GURL& frame_url, | 525 void OnMsgRunBeforeUnloadConfirm(const GURL& frame_url, |
| 517 const std::wstring& message, | 526 const std::wstring& message, |
| 518 IPC::Message* reply_msg); | 527 IPC::Message* reply_msg); |
| 519 void OnMsgShowModalHTMLDialog(const GURL& url, int width, int height, | 528 void OnMsgShowModalHTMLDialog(const GURL& url, int width, int height, |
| 520 const std::string& json_arguments, | 529 const std::string& json_arguments, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 // While in this mode, mouse click is converted into InspectElement | 657 // While in this mode, mouse click is converted into InspectElement |
| 649 // command. | 658 // command. |
| 650 bool in_inspect_element_mode_; | 659 bool in_inspect_element_mode_; |
| 651 | 660 |
| 652 NotificationRegistrar registrar_; | 661 NotificationRegistrar registrar_; |
| 653 | 662 |
| 654 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 663 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 655 }; | 664 }; |
| 656 | 665 |
| 657 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 666 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |