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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 std::unique_ptr<bool> active; | 51 std::unique_ptr<bool> active; |
52 std::unique_ptr<bool> pinned; | 52 std::unique_ptr<bool> pinned; |
53 std::unique_ptr<int> index; | 53 std::unique_ptr<int> index; |
54 }; | 54 }; |
55 | 55 |
56 // Opens a new tab given an extension function |function| and creation | 56 // Opens a new tab given an extension function |function| and creation |
57 // parameters |params|. Returns a Tab object if successful, or NULL and | 57 // parameters |params|. Returns a Tab object if successful, or NULL and |
58 // optionally sets |error| if an error occurs. | 58 // optionally sets |error| if an error occurs. |
59 static base::DictionaryValue* OpenTab(UIThreadExtensionFunction* function, | 59 static base::DictionaryValue* OpenTab(UIThreadExtensionFunction* function, |
60 const OpenTabParams& params, | 60 const OpenTabParams& params, |
| 61 bool user_gesture, |
61 std::string* error); | 62 std::string* error); |
62 | 63 |
63 static int GetWindowId(const Browser* browser); | 64 static int GetWindowId(const Browser* browser); |
64 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); | 65 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); |
65 static int GetTabId(const content::WebContents* web_contents); | 66 static int GetTabId(const content::WebContents* web_contents); |
66 static std::string GetTabStatusText(bool is_loading); | 67 static std::string GetTabStatusText(bool is_loading); |
67 static int GetWindowIdOfTab(const content::WebContents* web_contents); | 68 static int GetWindowIdOfTab(const content::WebContents* web_contents); |
68 static std::unique_ptr<base::ListValue> CreateTabList( | 69 static std::unique_ptr<base::ListValue> CreateTabList( |
69 const Browser* browser, | 70 const Browser* browser, |
70 const Extension* extension); | 71 const Extension* extension); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 static bool OpenOptionsPage(const Extension* extension, Browser* browser); | 174 static bool OpenOptionsPage(const Extension* extension, Browser* browser); |
174 | 175 |
175 // Returns true if the given Browser can report tabs to extensions. | 176 // Returns true if the given Browser can report tabs to extensions. |
176 // Example of Browsers which don't support tabs include apps and devtools. | 177 // Example of Browsers which don't support tabs include apps and devtools. |
177 static bool BrowserSupportsTabs(Browser* browser); | 178 static bool BrowserSupportsTabs(Browser* browser); |
178 }; | 179 }; |
179 | 180 |
180 } // namespace extensions | 181 } // namespace extensions |
181 | 182 |
182 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 183 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
OLD | NEW |