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_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
12 #include "content/browser/tab_contents/tab_contents_observer.h" | 12 #include "content/browser/tab_contents/tab_contents_observer.h" |
13 #include "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
14 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
15 | 15 |
16 class BackingStore; | 16 class BackingStore; |
17 class Browser; | 17 class Browser; |
18 class DictionaryValue; | |
19 class ListValue; | |
20 class SkBitmap; | 18 class SkBitmap; |
21 class TabContents; | 19 class TabContents; |
22 class TabContentsWrapper; | 20 class TabContentsWrapper; |
23 class TabStripModel; | 21 class TabStripModel; |
24 | 22 |
| 23 namespace base { |
| 24 class DictionaryValue; |
| 25 class ListValue; |
| 26 } |
| 27 |
25 namespace ExtensionTabUtil { | 28 namespace ExtensionTabUtil { |
26 int GetWindowId(const Browser* browser); | 29 int GetWindowId(const Browser* browser); |
27 int GetTabId(const TabContents* tab_contents); | 30 int GetTabId(const TabContents* tab_contents); |
28 std::string GetTabStatusText(bool is_loading); | 31 std::string GetTabStatusText(bool is_loading); |
29 int GetWindowIdOfTab(const TabContents* tab_contents); | 32 int GetWindowIdOfTab(const TabContents* tab_contents); |
30 ListValue* CreateTabList(const Browser* browser); | 33 base::ListValue* CreateTabList(const Browser* browser); |
31 DictionaryValue* CreateTabValue(const TabContents* tab_contents); | 34 base::DictionaryValue* CreateTabValue(const TabContents* tab_contents); |
32 DictionaryValue* CreateTabValue(const TabContents* tab_contents, | 35 base::DictionaryValue* CreateTabValue(const TabContents* tab_contents, |
33 TabStripModel* tab_strip, | 36 TabStripModel* tab_strip, |
34 int tab_index); | 37 int tab_index); |
35 // Create a tab value, overriding its kSelectedKey to the provided boolean. | 38 // Create a tab value, overriding its kSelectedKey to the provided boolean. |
36 DictionaryValue* CreateTabValueActive(const TabContents* tab_contents, | 39 base::DictionaryValue* CreateTabValueActive(const TabContents* tab_contents, |
37 bool active); | 40 bool active); |
38 DictionaryValue* CreateWindowValue(const Browser* browser, | 41 base::DictionaryValue* CreateWindowValue(const Browser* browser, |
39 bool populate_tabs); | 42 bool populate_tabs); |
40 // Gets the |tab_strip_model| and |tab_index| for the given |tab_contents|. | 43 // Gets the |tab_strip_model| and |tab_index| for the given |tab_contents|. |
41 bool GetTabStripModel(const TabContents* tab_contents, | 44 bool GetTabStripModel(const TabContents* tab_contents, |
42 TabStripModel** tab_strip_model, | 45 TabStripModel** tab_strip_model, |
43 int* tab_index); | 46 int* tab_index); |
44 bool GetDefaultTab(Browser* browser, | 47 bool GetDefaultTab(Browser* browser, |
45 TabContentsWrapper** contents, | 48 TabContentsWrapper** contents, |
46 int* tab_id); | 49 int* tab_id); |
47 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may | 50 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may |
48 // be NULL and will not be set within the function. | 51 // be NULL and will not be set within the function. |
49 bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, | 52 bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 179 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
177 ImageFormat image_format_; | 180 ImageFormat image_format_; |
178 | 181 |
179 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 182 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
180 int image_quality_; | 183 int image_quality_; |
181 | 184 |
182 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 185 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
183 }; | 186 }; |
184 | 187 |
185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 188 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
OLD | NEW |