| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 static int GetWindowId(const Browser* browser); | 25 static int GetWindowId(const Browser* browser); |
| 26 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); | 26 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); |
| 27 static int GetTabId(const TabContents* tab_contents); | 27 static int GetTabId(const TabContents* tab_contents); |
| 28 static bool GetTabIdFromArgument(const base::ListValue &args, | 28 static bool GetTabIdFromArgument(const base::ListValue &args, |
| 29 int argument_index, | 29 int argument_index, |
| 30 int *tab_id, std::string* error_message); | 30 int *tab_id, std::string* error_message); |
| 31 static std::string GetTabStatusText(bool is_loading); | 31 static std::string GetTabStatusText(bool is_loading); |
| 32 static int GetWindowIdOfTab(const TabContents* tab_contents); | 32 static int GetWindowIdOfTab(const TabContents* tab_contents); |
| 33 static std::string GetWindowTypeText(const Browser* browser); | 33 static std::string GetWindowTypeText(const Browser* browser); |
| 34 static std::string GetWindowShowStateText(const Browser* browser); |
| 34 static base::ListValue* CreateTabList(const Browser* browser); | 35 static base::ListValue* CreateTabList(const Browser* browser); |
| 35 static base::DictionaryValue* CreateTabValue( | 36 static base::DictionaryValue* CreateTabValue( |
| 36 const TabContents* tab_contents); | 37 const TabContents* tab_contents); |
| 37 static base::DictionaryValue* CreateTabValue(const TabContents* tab_contents, | 38 static base::DictionaryValue* CreateTabValue(const TabContents* tab_contents, |
| 38 TabStripModel* tab_strip, | 39 TabStripModel* tab_strip, |
| 39 int tab_index); | 40 int tab_index); |
| 40 // Create a tab value, overriding its kSelectedKey to the provided boolean. | 41 // Create a tab value, overriding its kSelectedKey to the provided boolean. |
| 41 static base::DictionaryValue* CreateTabValueActive( | 42 static base::DictionaryValue* CreateTabValueActive( |
| 42 const TabContents* tab_contents, | 43 const TabContents* tab_contents, |
| 43 bool active); | 44 bool active); |
| 44 static base::DictionaryValue* CreateWindowValue(const Browser* browser, | 45 static base::DictionaryValue* CreateWindowValue(const Browser* browser, |
| 45 bool populate_tabs); | 46 bool populate_tabs); |
| 46 // Gets the |tab_strip_model| and |tab_index| for the given |tab_contents|. | 47 // Gets the |tab_strip_model| and |tab_index| for the given |tab_contents|. |
| 47 static bool GetTabStripModel(const TabContents* tab_contents, | 48 static bool GetTabStripModel(const TabContents* tab_contents, |
| 48 TabStripModel** tab_strip_model, | 49 TabStripModel** tab_strip_model, |
| 49 int* tab_index); | 50 int* tab_index); |
| 50 static bool GetDefaultTab(Browser* browser, | 51 static bool GetDefaultTab(Browser* browser, |
| 51 TabContentsWrapper** contents, | 52 TabContentsWrapper** contents, |
| 52 int* tab_id); | 53 int* tab_id); |
| 53 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may | 54 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may |
| 54 // be NULL and will not be set within the function. | 55 // be NULL and will not be set within the function. |
| 55 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, | 56 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, |
| 56 Browser** browser, | 57 Browser** browser, |
| 57 TabStripModel** tab_strip, | 58 TabStripModel** tab_strip, |
| 58 TabContentsWrapper** contents, | 59 TabContentsWrapper** contents, |
| 59 int* tab_index); | 60 int* tab_index); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ | 63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ |
| OLD | NEW |