OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 // Sets the extension denoting this as an app. If |extension| is non-null this | 181 // Sets the extension denoting this as an app. If |extension| is non-null this |
182 // tab becomes an app-tab. TabContents does not listen for unload events for | 182 // tab becomes an app-tab. TabContents does not listen for unload events for |
183 // the extension. It's up to consumers of TabContents to do that. | 183 // the extension. It's up to consumers of TabContents to do that. |
184 // | 184 // |
185 // NOTE: this should only be manipulated before the tab is added to a browser. | 185 // NOTE: this should only be manipulated before the tab is added to a browser. |
186 // TODO(sky): resolve if this is the right way to identify an app tab. If it | 186 // TODO(sky): resolve if this is the right way to identify an app tab. If it |
187 // is, than this should be passed in the constructor. | 187 // is, than this should be passed in the constructor. |
188 void SetAppExtension(Extension* extension); | 188 void SetAppExtension(Extension* extension); |
| 189 |
| 190 // Convenience for setting the app extension by id. This does nothing if |
| 191 // |app_extension_id| is empty, or an extension can't be found given the |
| 192 // specified id. |
| 193 void SetAppExtensionById(const std::string& app_extension_id); |
| 194 |
189 Extension* app_extension() const { return app_extension_; } | 195 Extension* app_extension() const { return app_extension_; } |
190 bool is_app() const { return app_extension_ != NULL; } | 196 bool is_app() const { return app_extension_ != NULL; } |
191 | 197 |
192 #ifdef UNIT_TEST | 198 #ifdef UNIT_TEST |
193 // Expose the render manager for testing. | 199 // Expose the render manager for testing. |
194 RenderViewHostManager* render_manager() { return &render_manager_; } | 200 RenderViewHostManager* render_manager() { return &render_manager_; } |
195 #endif | 201 #endif |
196 | 202 |
197 // Tab navigation state ------------------------------------------------------ | 203 // Tab navigation state ------------------------------------------------------ |
198 | 204 |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1203 |
1198 // Information about the language the page is in and has been translated to. | 1204 // Information about the language the page is in and has been translated to. |
1199 LanguageState language_state_; | 1205 LanguageState language_state_; |
1200 | 1206 |
1201 // --------------------------------------------------------------------------- | 1207 // --------------------------------------------------------------------------- |
1202 | 1208 |
1203 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1209 DISALLOW_COPY_AND_ASSIGN(TabContents); |
1204 }; | 1210 }; |
1205 | 1211 |
1206 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1212 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |