| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 class Browser; | 11 class Browser; |
| 12 class Extension; |
| 13 class GURL; |
| 12 class Profile; | 14 class Profile; |
| 13 class TabContents; | 15 class TabContents; |
| 14 class TabContentsWrapper; | 16 class TabContentsWrapper; |
| 15 class TabStripModel; | 17 class TabStripModel; |
| 16 | 18 |
| 17 namespace base { | 19 namespace base { |
| 18 class DictionaryValue; | 20 class DictionaryValue; |
| 19 class ListValue; | 21 class ListValue; |
| 20 } | 22 } |
| 21 | 23 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 static bool GetDefaultTab(Browser* browser, | 57 static bool GetDefaultTab(Browser* browser, |
| 56 TabContentsWrapper** contents, | 58 TabContentsWrapper** contents, |
| 57 int* tab_id); | 59 int* tab_id); |
| 58 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may | 60 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may |
| 59 // be NULL and will not be set within the function. | 61 // be NULL and will not be set within the function. |
| 60 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, | 62 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, |
| 61 Browser** browser, | 63 Browser** browser, |
| 62 TabStripModel** tab_strip, | 64 TabStripModel** tab_strip, |
| 63 TabContentsWrapper** contents, | 65 TabContentsWrapper** contents, |
| 64 int* tab_index); | 66 int* tab_index); |
| 67 |
| 68 // Takes |url_string| and returns a GURL which is either valid and absolute |
| 69 // or invalid. If |url_string| is not directly interpretable as a valid (it is |
| 70 // likely a relative URL) an attempt is made to resolve it. |extension| is |
| 71 // provided so it can be resolved relative to its extension base |
| 72 // (chrome-extension://<id>/). Using the source frame url would be more |
| 73 // correct, but because the api shipped with urls resolved relative to their |
| 74 // extension base, we decided it wasn't worth breaking existing extensions to |
| 75 // fix. |
| 76 static GURL ResolvePossiblyRelativeURL(const std::string& url_string, |
| 77 const Extension* extension); |
| 78 |
| 79 // Returns true if |url| is used for testing crashes. |
| 80 static bool IsCrashURL(const GURL& url); |
| 65 }; | 81 }; |
| 66 | 82 |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ | 83 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H__ |
| OLD | NEW |