OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TAB_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 static base::DictionaryValue* OpenTab( | 61 static base::DictionaryValue* OpenTab( |
62 ChromeUIThreadExtensionFunction* function, | 62 ChromeUIThreadExtensionFunction* function, |
63 const OpenTabParams& params, | 63 const OpenTabParams& params, |
64 std::string* error); | 64 std::string* error); |
65 | 65 |
66 static int GetWindowId(const Browser* browser); | 66 static int GetWindowId(const Browser* browser); |
67 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); | 67 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); |
68 static int GetTabId(const content::WebContents* web_contents); | 68 static int GetTabId(const content::WebContents* web_contents); |
69 static std::string GetTabStatusText(bool is_loading); | 69 static std::string GetTabStatusText(bool is_loading); |
70 static int GetWindowIdOfTab(const content::WebContents* web_contents); | 70 static int GetWindowIdOfTab(const content::WebContents* web_contents); |
71 static base::ListValue* CreateTabList(const Browser* browser, | 71 static std::unique_ptr<base::ListValue> CreateTabList( |
72 const Extension* extension); | 72 const Browser* browser, |
| 73 const Extension* extension); |
73 | 74 |
74 // DEPRECATED: Please consider using ChromeExtensionFunctionDetails instead | 75 // DEPRECATED: Please consider using ChromeExtensionFunctionDetails instead |
75 // of the deprecated ChromeUIThreadExtensionFunction and use the overload | 76 // of the deprecated ChromeUIThreadExtensionFunction and use the overload |
76 // below | 77 // below |
77 static Browser* GetBrowserFromWindowID( | 78 static Browser* GetBrowserFromWindowID( |
78 ChromeUIThreadExtensionFunction* function, | 79 ChromeUIThreadExtensionFunction* function, |
79 int window_id, | 80 int window_id, |
80 std::string* error_message); | 81 std::string* error_message); |
81 | 82 |
82 static Browser* GetBrowserFromWindowID( | 83 static Browser* GetBrowserFromWindowID( |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 static bool OpenOptionsPage(const Extension* extension, Browser* browser); | 176 static bool OpenOptionsPage(const Extension* extension, Browser* browser); |
176 | 177 |
177 // Returns true if the given Browser can report tabs to extensions. | 178 // Returns true if the given Browser can report tabs to extensions. |
178 // Example of Browsers which don't support tabs include apps and devtools. | 179 // Example of Browsers which don't support tabs include apps and devtools. |
179 static bool BrowserSupportsTabs(Browser* browser); | 180 static bool BrowserSupportsTabs(Browser* browser); |
180 }; | 181 }; |
181 | 182 |
182 } // namespace extensions | 183 } // namespace extensions |
183 | 184 |
184 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
OLD | NEW |