| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 static bool OpenOptionsPage(const Extension* extension, Browser* browser); | 181 static bool OpenOptionsPage(const Extension* extension, Browser* browser); |
| 181 | 182 |
| 182 // Returns true if the given Browser can report tabs to extensions. | 183 // Returns true if the given Browser can report tabs to extensions. |
| 183 // Example of Browsers which don't support tabs include apps and devtools. | 184 // Example of Browsers which don't support tabs include apps and devtools. |
| 184 static bool BrowserSupportsTabs(Browser* browser); | 185 static bool BrowserSupportsTabs(Browser* browser); |
| 185 }; | 186 }; |
| 186 | 187 |
| 187 } // namespace extensions | 188 } // namespace extensions |
| 188 | 189 |
| 189 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 190 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
| OLD | NEW |