Chromium Code Reviews| Index: chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.cc |
| diff --git a/chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.cc b/chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..824c9c044354421b5f9ad23035f18520115ea7f5 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.cc |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.h" |
| + |
| +#include <string> |
| + |
| +#include "chrome/browser/profiles/profiles_state.h" |
| +#include "chrome/common/extensions/api/tabs.h" |
| + |
| +namespace extensions { |
| + |
| +ExtensionTabUtilDelegateChromeOS::ExtensionTabUtilDelegateChromeOS() {} |
| + |
| +ExtensionTabUtilDelegateChromeOS::~ExtensionTabUtilDelegateChromeOS() {} |
| + |
| +void ExtensionTabUtilDelegateChromeOS::ScrubTabForExtension( |
| + const Extension* extension, |
| + content::WebContents* contents, |
| + api::tabs::Tab* tab) { |
| + if (!profiles::IsPublicSession() || !tab->url) { |
| + return; |
| + } |
| + // Scrub URL down to the origin (security reasons inside Public Sessions). |
| + GURL gurl(*tab->url); |
| + std::string scrubbed_url = gurl.GetOrigin().spec(); |
| + tab->url.reset(new std::string(scrubbed_url)); |
|
Devlin
2017/04/20 16:33:18
could even one-line this:
tab->url = base::MakeUni
Ivan Šandrk
2017/04/20 16:44:10
Roger. I did it this way because that's how it was
|
| +} |
| + |
| +} // namespace extensions |