| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/printing/print_view_manager.h" |
| 14 #include "content/browser/tab_contents/tab_contents.h" | 15 #include "content/browser/tab_contents/tab_contents.h" |
| 15 #include "content/browser/tab_contents/tab_contents_observer.h" | 16 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 16 #include "content/common/notification_registrar.h" | 17 #include "content/common/notification_registrar.h" |
| 17 | 18 |
| 18 namespace prerender { | 19 namespace prerender { |
| 19 class PrerenderObserver; | 20 class PrerenderObserver; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace printing { | 23 namespace printing { |
| 23 class PrintPreviewMessageHandler; | 24 class PrintPreviewMessageHandler; |
| 24 class PrintViewManager; | |
| 25 } | 25 } |
| 26 | 26 |
| 27 class AutocompleteHistoryManager; | 27 class AutocompleteHistoryManager; |
| 28 class AutofillManager; | 28 class AutofillManager; |
| 29 class DevToolsObserver; | 29 class DevToolsObserver; |
| 30 class Extension; | 30 class Extension; |
| 31 class ExtensionMessageObserver; | 31 class ExtensionMessageObserver; |
| 32 class ExtensionTabHelper; | 32 class ExtensionTabHelper; |
| 33 class FaviconTabHelper; | 33 class FaviconTabHelper; |
| 34 class FileSelectObserver; | 34 class FileSelectObserver; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } | 107 FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } |
| 108 | 108 |
| 109 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } | 109 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } |
| 110 | 110 |
| 111 PasswordManager* password_manager() { return password_manager_.get(); } | 111 PasswordManager* password_manager() { return password_manager_.get(); } |
| 112 | 112 |
| 113 SearchEngineTabHelper* search_engine_tab_helper() { | 113 SearchEngineTabHelper* search_engine_tab_helper() { |
| 114 return search_engine_tab_helper_.get(); | 114 return search_engine_tab_helper_.get(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 printing::PrintViewManager* print_view_manager() { |
| 118 return print_view_manager_.get(); |
| 119 } |
| 120 |
| 117 // Overrides ----------------------------------------------------------------- | 121 // Overrides ----------------------------------------------------------------- |
| 118 | 122 |
| 119 // TabContentsObserver overrides: | 123 // TabContentsObserver overrides: |
| 120 virtual void DidNavigateMainFramePostCommit( | 124 virtual void DidNavigateMainFramePostCommit( |
| 121 const NavigationController::LoadCommittedDetails& details, | 125 const NavigationController::LoadCommittedDetails& details, |
| 122 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; | 126 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
| 123 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 127 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 124 | 128 |
| 125 // NotificationObserver overrides: | 129 // NotificationObserver overrides: |
| 126 virtual void Observe(NotificationType type, | 130 virtual void Observe(NotificationType type, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 149 TabContentsWrapperDelegate* delegate_; | 153 TabContentsWrapperDelegate* delegate_; |
| 150 | 154 |
| 151 // Registers and unregisters us for notifications. | 155 // Registers and unregisters us for notifications. |
| 152 NotificationRegistrar registrar_; | 156 NotificationRegistrar registrar_; |
| 153 | 157 |
| 154 // Data for current page ----------------------------------------------------- | 158 // Data for current page ----------------------------------------------------- |
| 155 | 159 |
| 156 // Whether the current URL is starred. | 160 // Whether the current URL is starred. |
| 157 bool is_starred_; | 161 bool is_starred_; |
| 158 | 162 |
| 159 // Handles print job for this contents. | |
| 160 scoped_ptr<printing::PrintViewManager> printing_; | |
| 161 | |
| 162 // Handles Print Preview messages. | |
| 163 scoped_ptr<printing::PrintPreviewMessageHandler> print_preview_; | |
| 164 | |
| 165 // Tab Helpers --------------------------------------------------------------- | 163 // Tab Helpers --------------------------------------------------------------- |
| 166 // (These provide API for callers and have a getter function listed in the | 164 // (These provide API for callers and have a getter function listed in the |
| 167 // "Tab Helpers" section in the member functions area, above.) | 165 // "Tab Helpers" section in the member functions area, above.) |
| 168 | 166 |
| 169 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; | 167 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; |
| 170 scoped_ptr<AutofillManager> autofill_manager_; | 168 scoped_ptr<AutofillManager> autofill_manager_; |
| 171 scoped_ptr<ExtensionTabHelper> extension_tab_helper_; | 169 scoped_ptr<ExtensionTabHelper> extension_tab_helper_; |
| 172 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; | 170 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; |
| 173 scoped_ptr<FindTabHelper> find_tab_helper_; | 171 scoped_ptr<FindTabHelper> find_tab_helper_; |
| 174 | 172 |
| 175 // PasswordManager and its delegate. The delegate must outlive the manager, | 173 // PasswordManager and its delegate. The delegate must outlive the manager, |
| 176 // per documentation in password_manager.h. | 174 // per documentation in password_manager.h. |
| 177 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; | 175 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; |
| 178 scoped_ptr<PasswordManager> password_manager_; | 176 scoped_ptr<PasswordManager> password_manager_; |
| 179 | 177 |
| 180 scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_; | 178 scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_; |
| 181 | 179 |
| 180 // Handles print job for this contents. |
| 181 scoped_ptr<printing::PrintViewManager> print_view_manager_; |
| 182 |
| 182 // Per-tab observers --------------------------------------------------------- | 183 // Per-tab observers --------------------------------------------------------- |
| 183 // (These provide no API for callers; objects that need to exist 1:1 with tabs | 184 // (These provide no API for callers; objects that need to exist 1:1 with tabs |
| 184 // and silently do their thing live here.) | 185 // and silently do their thing live here.) |
| 185 | 186 |
| 186 scoped_ptr<DevToolsObserver> dev_tools_observer_; | 187 scoped_ptr<DevToolsObserver> dev_tools_observer_; |
| 187 scoped_ptr<ExtensionMessageObserver> extension_message_observer_; | 188 scoped_ptr<ExtensionMessageObserver> extension_message_observer_; |
| 188 scoped_ptr<FileSelectObserver> file_select_observer_; | 189 scoped_ptr<FileSelectObserver> file_select_observer_; |
| 189 scoped_ptr<prerender::PrerenderObserver> prerender_observer_; | 190 scoped_ptr<prerender::PrerenderObserver> prerender_observer_; |
| 191 scoped_ptr<printing::PrintPreviewMessageHandler> print_preview_; |
| 190 | 192 |
| 191 // TabContents (MUST BE LAST) ------------------------------------------------ | 193 // TabContents (MUST BE LAST) ------------------------------------------------ |
| 192 | 194 |
| 193 // The supporting objects need to outlive the TabContents dtor (as they may | 195 // The supporting objects need to outlive the TabContents dtor (as they may |
| 194 // be called upon during its execution). As a result, this must come last | 196 // be called upon during its execution). As a result, this must come last |
| 195 // in the list. | 197 // in the list. |
| 196 scoped_ptr<TabContents> tab_contents_; | 198 scoped_ptr<TabContents> tab_contents_; |
| 197 | 199 |
| 198 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); | 200 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); |
| 199 }; | 201 }; |
| 200 | 202 |
| 201 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 203 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
| OLD | NEW |