| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROMEOS_
H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROMEOS_
H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROMEOS_
H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROMEOS_
H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 11 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 | 12 |
| 11 namespace api { | 13 namespace api { |
| 12 namespace tabs { | 14 namespace tabs { |
| 13 class Tab; | 15 class Tab; |
| 14 } | 16 } |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace content { | |
| 18 class WebContents; | |
| 19 } | |
| 20 | |
| 21 namespace extensions { | 19 namespace extensions { |
| 22 class Extension; | |
| 23 | 20 |
| 24 // In Public Sessions, apps and extensions are force-installed by admin policy | 21 // In Public Sessions, apps and extensions are force-installed by admin policy |
| 25 // so the user does not get a chance to review the permissions for these apps. | 22 // so the user does not get a chance to review the permissions for these apps. |
| 26 // This is not acceptable from a security standpoint, so we scrub the URL | 23 // This is not acceptable from a security standpoint, so we scrub the URL |
| 27 // returned by chrome.tabs API down to the origin. | 24 // returned by chrome.tabs API down to the origin unless the extension ID is |
| 25 // whitelisted. |
| 28 class ExtensionTabUtilDelegateChromeOS : public ExtensionTabUtil::Delegate { | 26 class ExtensionTabUtilDelegateChromeOS : public ExtensionTabUtil::Delegate { |
| 29 public: | 27 public: |
| 30 ExtensionTabUtilDelegateChromeOS(); | 28 ExtensionTabUtilDelegateChromeOS(); |
| 31 ~ExtensionTabUtilDelegateChromeOS() override; | 29 ~ExtensionTabUtilDelegateChromeOS() override; |
| 32 | 30 |
| 33 // ExtensionTabUtil::Delegate | 31 // ExtensionTabUtil::Delegate |
| 34 void ScrubTabForExtension(const Extension* extension, | 32 void ScrubTabForExtension(const std::string& extension_id, |
| 35 content::WebContents* contents, | |
| 36 api::tabs::Tab* tab) override; | 33 api::tabs::Tab* tab) override; |
| 37 | 34 |
| 38 private: | 35 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(ExtensionTabUtilDelegateChromeOS); | 36 DISALLOW_COPY_AND_ASSIGN(ExtensionTabUtilDelegateChromeOS); |
| 40 }; | 37 }; |
| 41 | 38 |
| 42 } // namespace extensions | 39 } // namespace extensions |
| 43 | 40 |
| 44 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROME
OS_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTENSION_TAB_UTIL_DELEGATE_CHROME
OS_H_ |
| OLD | NEW |