| 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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace printing { | 22 namespace printing { |
| 23 class PrintPreviewMessageHandler; | 23 class PrintPreviewMessageHandler; |
| 24 class PrintViewManager; | 24 class PrintViewManager; |
| 25 } | 25 } |
| 26 | 26 |
| 27 class AutocompleteHistoryManager; | 27 class AutocompleteHistoryManager; |
| 28 class AutofillManager; | 28 class AutofillManager; |
| 29 class DevToolsTabHelper; | 29 class DevToolsTabHelper; |
| 30 class Extension; | 30 class Extension; |
| 31 class ExtensionTabHelper; |
| 31 class FileSelectObserver; | 32 class FileSelectObserver; |
| 32 class FindTabHelper; | 33 class FindTabHelper; |
| 33 class NavigationController; | 34 class NavigationController; |
| 34 class PasswordManager; | 35 class PasswordManager; |
| 35 class PasswordManagerDelegate; | 36 class PasswordManagerDelegate; |
| 36 class SearchEngineTabHelper; | 37 class SearchEngineTabHelper; |
| 37 class TabContentsWrapperDelegate; | 38 class TabContentsWrapperDelegate; |
| 38 | 39 |
| 39 // Wraps TabContents and all of its supporting objects in order to control | 40 // Wraps TabContents and all of its supporting objects in order to control |
| 40 // their ownership and lifetime, while allowing TabContents to remain generic | 41 // their ownership and lifetime, while allowing TabContents to remain generic |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 TabContents* tab_contents() const { return tab_contents_.get(); } | 82 TabContents* tab_contents() const { return tab_contents_.get(); } |
| 82 NavigationController& controller() const { | 83 NavigationController& controller() const { |
| 83 return tab_contents()->controller(); | 84 return tab_contents()->controller(); |
| 84 } | 85 } |
| 85 TabContentsView* view() const { return tab_contents()->view(); } | 86 TabContentsView* view() const { return tab_contents()->view(); } |
| 86 RenderViewHost* render_view_host() const { | 87 RenderViewHost* render_view_host() const { |
| 87 return tab_contents()->render_view_host(); | 88 return tab_contents()->render_view_host(); |
| 88 } | 89 } |
| 89 Profile* profile() const { return tab_contents()->profile(); } | 90 Profile* profile() const { return tab_contents()->profile(); } |
| 90 | |
| 91 // Convenience methods until extensions are removed from TabContents. | |
| 92 void SetExtensionAppById(const std::string& extension_app_id) { | |
| 93 tab_contents()->SetExtensionAppById(extension_app_id); | |
| 94 } | |
| 95 const Extension* extension_app() const { | |
| 96 return tab_contents()->extension_app(); | |
| 97 } | |
| 98 bool is_app() const { return tab_contents()->is_app(); } | |
| 99 | |
| 100 bool is_starred() const { return is_starred_; } | 91 bool is_starred() const { return is_starred_; } |
| 101 | 92 |
| 102 // Tab Helpers --------------------------------------------------------------- | 93 // Tab Helpers --------------------------------------------------------------- |
| 103 | 94 |
| 104 AutocompleteHistoryManager* autocomplete_history_manager() { | 95 AutocompleteHistoryManager* autocomplete_history_manager() { |
| 105 return autocomplete_history_manager_.get(); | 96 return autocomplete_history_manager_.get(); |
| 106 } | 97 } |
| 107 | 98 |
| 108 AutofillManager* autofill_manager() { return autofill_manager_.get(); } | 99 AutofillManager* autofill_manager() { return autofill_manager_.get(); } |
| 109 | 100 |
| 101 ExtensionTabHelper* extension_tab_helper() { |
| 102 return extension_tab_helper_.get(); |
| 103 } |
| 104 |
| 110 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } | 105 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } |
| 111 | 106 |
| 112 PasswordManager* password_manager() { return password_manager_.get(); } | 107 PasswordManager* password_manager() { return password_manager_.get(); } |
| 113 | 108 |
| 114 SearchEngineTabHelper* search_engine_tab_helper() { | 109 SearchEngineTabHelper* search_engine_tab_helper() { |
| 115 return search_engine_tab_helper_.get(); | 110 return search_engine_tab_helper_.get(); |
| 116 } | 111 } |
| 117 | 112 |
| 118 // Overrides ----------------------------------------------------------------- | 113 // Overrides ----------------------------------------------------------------- |
| 119 | 114 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Tab Helpers --------------------------------------------------------------- | 161 // Tab Helpers --------------------------------------------------------------- |
| 167 // (These provide API for callers and have a getter function listed in the | 162 // (These provide API for callers and have a getter function listed in the |
| 168 // "Tab Helpers" section in the member functions area, above.) | 163 // "Tab Helpers" section in the member functions area, above.) |
| 169 | 164 |
| 170 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; | 165 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; |
| 171 | 166 |
| 172 scoped_ptr<AutofillManager> autofill_manager_; | 167 scoped_ptr<AutofillManager> autofill_manager_; |
| 173 | 168 |
| 174 scoped_ptr<DevToolsTabHelper> dev_tools_tab_helper_; | 169 scoped_ptr<DevToolsTabHelper> dev_tools_tab_helper_; |
| 175 | 170 |
| 171 scoped_ptr<ExtensionTabHelper> extension_tab_helper_; |
| 172 |
| 176 scoped_ptr<FindTabHelper> find_tab_helper_; | 173 scoped_ptr<FindTabHelper> find_tab_helper_; |
| 177 | 174 |
| 178 // PasswordManager and its delegate. The delegate must outlive the manager, | 175 // PasswordManager and its delegate. The delegate must outlive the manager, |
| 179 // per documentation in password_manager.h. | 176 // per documentation in password_manager.h. |
| 180 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; | 177 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; |
| 181 scoped_ptr<PasswordManager> password_manager_; | 178 scoped_ptr<PasswordManager> password_manager_; |
| 182 | 179 |
| 183 scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_; | 180 scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_; |
| 184 | 181 |
| 185 // Per-tab observers --------------------------------------------------------- | 182 // Per-tab observers --------------------------------------------------------- |
| 186 // (These provide no API for callers; objects that need to exist 1:1 with tabs | 183 // (These provide no API for callers; objects that need to exist 1:1 with tabs |
| 187 // and silently do their thing live here.) | 184 // and silently do their thing live here.) |
| 188 | 185 |
| 189 scoped_ptr<FileSelectObserver> file_select_observer_; | 186 scoped_ptr<FileSelectObserver> file_select_observer_; |
| 190 scoped_ptr<prerender::PrerenderObserver> prerender_observer_; | 187 scoped_ptr<prerender::PrerenderObserver> prerender_observer_; |
| 191 | 188 |
| 192 // TabContents (MUST BE LAST) ------------------------------------------------ | 189 // TabContents (MUST BE LAST) ------------------------------------------------ |
| 193 | 190 |
| 194 // The supporting objects need to outlive the TabContents dtor (as they may | 191 // The supporting objects need to outlive the TabContents dtor (as they may |
| 195 // be called upon during its execution). As a result, this must come last | 192 // be called upon during its execution). As a result, this must come last |
| 196 // in the list. | 193 // in the list. |
| 197 scoped_ptr<TabContents> tab_contents_; | 194 scoped_ptr<TabContents> tab_contents_; |
| 198 | 195 |
| 199 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); | 196 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); |
| 200 }; | 197 }; |
| 201 | 198 |
| 202 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 199 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
| OLD | NEW |