| 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/page_zoom.h" | 17 #include "chrome/common/page_zoom.h" |
| 17 #include "webkit/api/public/WebConsoleMessage.h" | 18 #include "webkit/api/public/WebConsoleMessage.h" |
| 18 #include "webkit/glue/autofill_form.h" | 19 #include "webkit/glue/autofill_form.h" |
| 19 #include "webkit/glue/password_form_dom_manager.h" | 20 #include "webkit/glue/password_form_dom_manager.h" |
| 20 #include "webkit/glue/window_open_disposition.h" | 21 #include "webkit/glue/window_open_disposition.h" |
| 21 | 22 |
| 22 class RenderViewHostDelegate; | 23 class RenderViewHostDelegate; |
| 23 class SiteInstance; | 24 class SiteInstance; |
| 24 class SkBitmap; | 25 class SkBitmap; |
| 25 class ViewMsg_Navigate; | 26 class ViewMsg_Navigate; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // contain things that are not relevant to a common subset of views. See also | 67 // contain things that are not relevant to a common subset of views. See also |
| 67 // the comment in render_view_host_delegate.h about the size and scope of the | 68 // the comment in render_view_host_delegate.h about the size and scope of the |
| 68 // delegate API. | 69 // delegate API. |
| 69 // | 70 // |
| 70 // Right now, the concept of page navigation (both top level and frame) exists | 71 // Right now, the concept of page navigation (both top level and frame) exists |
| 71 // in the TabContents still, so if you instantiate one of these elsewhere, you | 72 // in the TabContents still, so if you instantiate one of these elsewhere, you |
| 72 // will not be able to traverse pages back and forward. We need to determine | 73 // will not be able to traverse pages back and forward. We need to determine |
| 73 // if we want to bring that and other functionality down into this object so | 74 // if we want to bring that and other functionality down into this object so |
| 74 // it can be shared by others. | 75 // it can be shared by others. |
| 75 // | 76 // |
| 76 class RenderViewHost : public RenderWidgetHost { | 77 class RenderViewHost : public RenderWidgetHost, |
| 78 public NotificationObserver { |
| 77 public: | 79 public: |
| 78 // Returns the RenderViewHost given its ID and the ID of its render process. | 80 // Returns the RenderViewHost given its ID and the ID of its render process. |
| 79 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 81 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
| 80 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 82 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 81 | 83 |
| 82 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in | 84 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in |
| 83 // which case RenderWidgetHost will create a new one. modal_dialog_event is | 85 // which case RenderWidgetHost will create a new one. modal_dialog_event is |
| 84 // the event that's set when showing a modal dialog so that the renderer and | 86 // the event that's set when showing a modal dialog so that the renderer and |
| 85 // plugin processes know to pump messages. An existing event can be passed | 87 // plugin processes know to pump messages. An existing event can be passed |
| 86 // in, otherwise if it's NULL a new event will be created. | 88 // in, otherwise if it's NULL a new event will be created. |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 int request_id, bool has_callback); | 532 int request_id, bool has_callback); |
| 531 void OnExtensionPostMessage(int port_id, const std::string& message); | 533 void OnExtensionPostMessage(int port_id, const std::string& message); |
| 532 void OnAccessibilityFocusChange(int acc_obj_id); | 534 void OnAccessibilityFocusChange(int acc_obj_id); |
| 533 void OnCSSInserted(); | 535 void OnCSSInserted(); |
| 534 | 536 |
| 535 private: | 537 private: |
| 536 friend class TestRenderViewHost; | 538 friend class TestRenderViewHost; |
| 537 | 539 |
| 538 void UpdateBackForwardListCount(); | 540 void UpdateBackForwardListCount(); |
| 539 | 541 |
| 542 // NotificationObserver implementation. |
| 543 void Observe(NotificationType type, |
| 544 const NotificationSource& source, |
| 545 const NotificationDetails& details); |
| 546 |
| 540 // The SiteInstance associated with this RenderViewHost. All pages drawn | 547 // The SiteInstance associated with this RenderViewHost. All pages drawn |
| 541 // in this RenderViewHost are part of this SiteInstance. Should not change | 548 // in this RenderViewHost are part of this SiteInstance. Should not change |
| 542 // over time. | 549 // over time. |
| 543 scoped_refptr<SiteInstance> instance_; | 550 scoped_refptr<SiteInstance> instance_; |
| 544 | 551 |
| 545 // Our delegate, which wants to know about changes in the RenderView. | 552 // Our delegate, which wants to know about changes in the RenderView. |
| 546 RenderViewHostDelegate* delegate_; | 553 RenderViewHostDelegate* delegate_; |
| 547 | 554 |
| 548 // true if we are currently waiting for a response for drag context | 555 // true if we are currently waiting for a response for drag context |
| 549 // information. | 556 // information. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 // must return to the renderer to unblock it. | 592 // must return to the renderer to unblock it. |
| 586 IPC::Message* run_modal_reply_msg_; | 593 IPC::Message* run_modal_reply_msg_; |
| 587 | 594 |
| 588 bool is_waiting_for_unload_ack_; | 595 bool is_waiting_for_unload_ack_; |
| 589 | 596 |
| 590 bool are_javascript_messages_suppressed_; | 597 bool are_javascript_messages_suppressed_; |
| 591 | 598 |
| 592 // True if the render view can be shut down suddenly. | 599 // True if the render view can be shut down suddenly. |
| 593 bool sudden_termination_allowed_; | 600 bool sudden_termination_allowed_; |
| 594 | 601 |
| 602 NotificationRegistrar registrar_; |
| 603 |
| 595 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 604 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 596 }; | 605 }; |
| 597 | 606 |
| 598 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 607 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |