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_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 <map> | 10 #include <map> |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 // Indicates whether this tab should be considered crashed. The setter will | 248 // Indicates whether this tab should be considered crashed. The setter will |
249 // also notify the delegate when the flag is changed. | 249 // also notify the delegate when the flag is changed. |
250 bool is_crashed() const { return is_crashed_; } | 250 bool is_crashed() const { return is_crashed_; } |
251 void SetIsCrashed(bool state); | 251 void SetIsCrashed(bool state); |
252 | 252 |
253 // Adds/removes a page action to the list of page actions that are active in | 253 // Adds/removes a page action to the list of page actions that are active in |
254 // this tab. The parameter |title| (if not empty) can be used to override the | 254 // this tab. The parameter |title| (if not empty) can be used to override the |
255 // page action title for this tab and |icon_id| specifies an icon index | 255 // page action title for this tab and |icon_id| specifies an icon index |
256 // (defined in the manifest) to use instead of the first icon (for this tab). | 256 // (defined in the manifest) to use instead of the first icon (for this tab). |
257 void SetPageActionEnabled(const PageAction* page_action, bool enable, | 257 void SetPageActionEnabled(const ContextualAction* page_action, bool enable, |
258 const std::string& title, int icon_id); | 258 const std::string& title, int icon_id); |
259 | 259 |
260 // Returns the page action state for this tab. The pair returns contains | 260 // Returns the page action state for this tab. The pair returns contains |
261 // the title (string) for the page action and the icon index to use (int). | 261 // the title (string) for the page action and the icon index to use (int). |
262 // If this function returns NULL it means the page action is not enabled for | 262 // If this function returns NULL it means the page action is not enabled for |
263 // this tab. | 263 // this tab. |
264 const PageActionState* GetPageActionState(const PageAction* page_action); | 264 const ContextualActionState* GetPageActionState( |
| 265 const ContextualAction* page_action); |
265 | 266 |
266 // Whether the tab is in the process of being destroyed. | 267 // Whether the tab is in the process of being destroyed. |
267 // Added as a tentative work-around for focus related bug #4633. This allows | 268 // Added as a tentative work-around for focus related bug #4633. This allows |
268 // us not to store focus when a tab is being closed. | 269 // us not to store focus when a tab is being closed. |
269 bool is_being_destroyed() const { return is_being_destroyed_; } | 270 bool is_being_destroyed() const { return is_being_destroyed_; } |
270 | 271 |
271 // Convenience method for notifying the delegate of a navigation state | 272 // Convenience method for notifying the delegate of a navigation state |
272 // change. See TabContentsDelegate. | 273 // change. See TabContentsDelegate. |
273 void NotifyNavigationStateChanged(unsigned changed_flags); | 274 void NotifyNavigationStateChanged(unsigned changed_flags); |
274 | 275 |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 // matches, the find selection rectangle, etc. The UI can access this | 1086 // matches, the find selection rectangle, etc. The UI can access this |
1086 // information to build its presentation. | 1087 // information to build its presentation. |
1087 FindNotificationDetails last_search_result_; | 1088 FindNotificationDetails last_search_result_; |
1088 | 1089 |
1089 // Data for Page Actions ----------------------------------------------------- | 1090 // Data for Page Actions ----------------------------------------------------- |
1090 | 1091 |
1091 // A map of page actions that are enabled in this tab (and a state object | 1092 // A map of page actions that are enabled in this tab (and a state object |
1092 // that can be used to override the title and icon used for the page action). | 1093 // that can be used to override the title and icon used for the page action). |
1093 // This map is cleared every time the mainframe navigates and populated by the | 1094 // This map is cleared every time the mainframe navigates and populated by the |
1094 // PageAction extension API. | 1095 // PageAction extension API. |
1095 std::map< const PageAction*, linked_ptr<PageActionState> > | 1096 std::map< const ContextualAction*, linked_ptr<ContextualActionState> > |
1096 enabled_page_actions_; | 1097 enabled_page_actions_; |
1097 | 1098 |
1098 // Data for misc internal state ---------------------------------------------- | 1099 // Data for misc internal state ---------------------------------------------- |
1099 | 1100 |
1100 // See capturing_contents() above. | 1101 // See capturing_contents() above. |
1101 bool capturing_contents_; | 1102 bool capturing_contents_; |
1102 | 1103 |
1103 // See getter above. | 1104 // See getter above. |
1104 bool is_being_destroyed_; | 1105 bool is_being_destroyed_; |
1105 | 1106 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 // If this tab was created from a renderer using window.open, this will be | 1138 // If this tab was created from a renderer using window.open, this will be |
1138 // non-NULL and represent the DOMUI of the opening renderer. | 1139 // non-NULL and represent the DOMUI of the opening renderer. |
1139 DOMUITypeID opener_dom_ui_type_; | 1140 DOMUITypeID opener_dom_ui_type_; |
1140 | 1141 |
1141 // --------------------------------------------------------------------------- | 1142 // --------------------------------------------------------------------------- |
1142 | 1143 |
1143 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1144 DISALLOW_COPY_AND_ASSIGN(TabContents); |
1144 }; | 1145 }; |
1145 | 1146 |
1146 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1147 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |