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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const content::WebContents* web_contents); | 47 const content::WebContents* web_contents); |
48 static base::DictionaryValue* CreateTabValue( | 48 static base::DictionaryValue* CreateTabValue( |
49 const content::WebContents* web_contents, | 49 const content::WebContents* web_contents, |
50 TabStripModel* tab_strip, | 50 TabStripModel* tab_strip, |
51 int tab_index); | 51 int tab_index); |
52 // Create a tab value, overriding its kSelectedKey to the provided boolean. | 52 // Create a tab value, overriding its kSelectedKey to the provided boolean. |
53 static base::DictionaryValue* CreateTabValueActive( | 53 static base::DictionaryValue* CreateTabValueActive( |
54 const content::WebContents* web_contents, | 54 const content::WebContents* web_contents, |
55 bool active); | 55 bool active); |
56 | 56 |
| 57 static void StripTabOfSensitiveData(base::DictionaryValue* tab); |
| 58 |
57 // Gets the |tab_strip_model| and |tab_index| for the given |web_contents|. | 59 // Gets the |tab_strip_model| and |tab_index| for the given |web_contents|. |
58 static bool GetTabStripModel(const content::WebContents* web_contents, | 60 static bool GetTabStripModel(const content::WebContents* web_contents, |
59 TabStripModel** tab_strip_model, | 61 TabStripModel** tab_strip_model, |
60 int* tab_index); | 62 int* tab_index); |
61 static bool GetDefaultTab(Browser* browser, | 63 static bool GetDefaultTab(Browser* browser, |
62 TabContents** contents, | 64 TabContents** contents, |
63 int* tab_id); | 65 int* tab_id); |
64 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may | 66 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may |
65 // be NULL and will not be set within the function. | 67 // be NULL and will not be set within the function. |
66 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, | 68 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, |
(...skipping 25 matching lines...) Expand all Loading... |
92 | 94 |
93 // Executes the specified callback for all tabs in all browser windows. | 95 // Executes the specified callback for all tabs in all browser windows. |
94 static void ForEachTab( | 96 static void ForEachTab( |
95 const base::Callback<void(content::WebContents*)>& callback); | 97 const base::Callback<void(content::WebContents*)>& callback); |
96 | 98 |
97 static extensions::WindowController* GetWindowControllerOfTab( | 99 static extensions::WindowController* GetWindowControllerOfTab( |
98 const content::WebContents* web_contents); | 100 const content::WebContents* web_contents); |
99 }; | 101 }; |
100 | 102 |
101 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ | 103 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ |
OLD | NEW |