OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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_TAB_CONTENTS_WEB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class AutofillForm; | 36 class AutofillForm; |
37 class AutofillManager; | 37 class AutofillManager; |
38 class DOMUI; | 38 class DOMUI; |
39 class InterstitialPageDelegate; | 39 class InterstitialPageDelegate; |
40 class LoadNotificationDetails; | 40 class LoadNotificationDetails; |
41 class PasswordManager; | 41 class PasswordManager; |
42 class PluginInstaller; | 42 class PluginInstaller; |
43 class RenderProcessHost; | 43 class RenderProcessHost; |
44 class RenderViewHost; | 44 class RenderViewHost; |
45 class RenderViewHostFactory; | |
46 class RenderWidgetHost; | 45 class RenderWidgetHost; |
47 struct ThumbnailScore; | 46 struct ThumbnailScore; |
48 struct ViewHostMsg_FrameNavigate_Params; | 47 struct ViewHostMsg_FrameNavigate_Params; |
49 struct ViewHostMsg_DidPrintPage_Params; | 48 struct ViewHostMsg_DidPrintPage_Params; |
50 class WebContentsView; | 49 class WebContentsView; |
51 | 50 |
52 namespace base { | 51 namespace base { |
53 class WaitableEvent; | 52 class WaitableEvent; |
54 } | 53 } |
55 | 54 |
(...skipping 12 matching lines...) Expand all Loading... |
68 public RenderViewHostManager::Delegate, | 67 public RenderViewHostManager::Delegate, |
69 public SelectFileDialog::Listener { | 68 public SelectFileDialog::Listener { |
70 public: | 69 public: |
71 // If instance is NULL, then creates a new process for this view. Otherwise | 70 // If instance is NULL, then creates a new process for this view. Otherwise |
72 // initialize with a process already created for a different WebContents. | 71 // initialize with a process already created for a different WebContents. |
73 // This will share the process between views in the same instance. If | 72 // This will share the process between views in the same instance. If |
74 // render_view_factory is NULL, this will create RenderViewHost objects | 73 // render_view_factory is NULL, this will create RenderViewHost objects |
75 // directly. | 74 // directly. |
76 WebContents(Profile* profile, | 75 WebContents(Profile* profile, |
77 SiteInstance* instance, | 76 SiteInstance* instance, |
78 RenderViewHostFactory* render_view_factory, | |
79 int routing_id, | 77 int routing_id, |
80 base::WaitableEvent* modal_dialog_event); | 78 base::WaitableEvent* modal_dialog_event); |
81 | 79 |
82 static void RegisterUserPrefs(PrefService* prefs); | 80 static void RegisterUserPrefs(PrefService* prefs); |
83 | 81 |
84 // Getters ------------------------------------------------------------------- | 82 // Getters ------------------------------------------------------------------- |
85 | 83 |
86 // Returns the AutofillManager, creating it if necessary. | 84 // Returns the AutofillManager, creating it if necessary. |
87 AutofillManager* GetAutofillManager(); | 85 AutofillManager* GetAutofillManager(); |
88 | 86 |
(...skipping 13 matching lines...) Expand all Loading... |
102 } | 100 } |
103 RenderViewHost* render_view_host() const { | 101 RenderViewHost* render_view_host() const { |
104 return render_manager_.current_host(); | 102 return render_manager_.current_host(); |
105 } | 103 } |
106 | 104 |
107 // The WebContentsView will never change and is guaranteed non-NULL. | 105 // The WebContentsView will never change and is guaranteed non-NULL. |
108 WebContentsView* view() const { | 106 WebContentsView* view() const { |
109 return view_.get(); | 107 return view_.get(); |
110 } | 108 } |
111 | 109 |
| 110 #ifdef UNIT_TEST |
112 // Expose the render manager for testing. | 111 // Expose the render manager for testing. |
113 RenderViewHostManager* render_manager() { return &render_manager_; } | 112 RenderViewHostManager* render_manager() { return &render_manager_; } |
| 113 #endif |
114 | 114 |
115 // Page state getters & setters ---------------------------------------------- | 115 // Page state getters & setters ---------------------------------------------- |
116 | 116 |
117 bool is_starred() const { return is_starred_; } | 117 bool is_starred() const { return is_starred_; } |
118 | 118 |
119 const std::wstring& encoding() const { return encoding_; } | 119 const std::wstring& encoding() const { return encoding_; } |
120 void set_encoding(const std::wstring& encoding) { | 120 void set_encoding(const std::wstring& encoding) { |
121 encoding_ = encoding; | 121 encoding_ = encoding; |
122 } | 122 } |
123 | 123 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 DOMUI* GetDOMUIForCurrentState(); | 590 DOMUI* GetDOMUIForCurrentState(); |
591 | 591 |
592 // Data ---------------------------------------------------------------------- | 592 // Data ---------------------------------------------------------------------- |
593 | 593 |
594 // The corresponding view. | 594 // The corresponding view. |
595 scoped_ptr<WebContentsView> view_; | 595 scoped_ptr<WebContentsView> view_; |
596 | 596 |
597 // Manages creation and swapping of render views. | 597 // Manages creation and swapping of render views. |
598 RenderViewHostManager render_manager_; | 598 RenderViewHostManager render_manager_; |
599 | 599 |
600 // For testing, passed to new RenderViewHost managers. | |
601 RenderViewHostFactory* render_view_factory_; | |
602 | |
603 // Handles print preview and print job for this contents. | 600 // Handles print preview and print job for this contents. |
604 printing::PrintViewManager printing_; | 601 printing::PrintViewManager printing_; |
605 | 602 |
606 // Indicates whether we should notify about disconnection of this | 603 // Indicates whether we should notify about disconnection of this |
607 // WebContents. This is used to ensure disconnection notifications only | 604 // WebContents. This is used to ensure disconnection notifications only |
608 // happen if a connection notification has happened and that they happen only | 605 // happen if a connection notification has happened and that they happen only |
609 // once. | 606 // once. |
610 bool notify_disconnection_; | 607 bool notify_disconnection_; |
611 | 608 |
612 // Maps from handle to page_id. | 609 // Maps from handle to page_id. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 700 |
704 // The last find result. This object contains details about the number of | 701 // The last find result. This object contains details about the number of |
705 // matches, the find selection rectangle, etc. The UI can access this | 702 // matches, the find selection rectangle, etc. The UI can access this |
706 // information to build its presentation. | 703 // information to build its presentation. |
707 FindNotificationDetails find_result_; | 704 FindNotificationDetails find_result_; |
708 | 705 |
709 DISALLOW_COPY_AND_ASSIGN(WebContents); | 706 DISALLOW_COPY_AND_ASSIGN(WebContents); |
710 }; | 707 }; |
711 | 708 |
712 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ | 709 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
OLD | NEW |