Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeo s.h" | |
| 6 | |
| 7 #include <string> | |
| 8 | |
| 9 #include "chrome/browser/profiles/profiles_state.h" | |
| 10 #include "chrome/common/extensions/api/tabs.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 ExtensionTabUtilDelegateChromeOS::ExtensionTabUtilDelegateChromeOS() {} | |
| 15 | |
| 16 ExtensionTabUtilDelegateChromeOS::~ExtensionTabUtilDelegateChromeOS() {} | |
| 17 | |
| 18 void ExtensionTabUtilDelegateChromeOS::ScrubTabForExtension( | |
| 19 const Extension* extension, | |
| 20 content::WebContents* contents, | |
| 21 api::tabs::Tab* tab) { | |
| 22 if (!profiles::IsPublicSession() || !tab->url) { | |
| 23 return; | |
| 24 } | |
| 25 // Scrub URL down to the origin (security reasons inside Public Sessions). | |
| 26 GURL gurl(*tab->url); | |
| 27 std::string scrubbed_url = gurl.GetOrigin().spec(); | |
| 28 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
| |
| 29 } | |
| 30 | |
| 31 } // namespace extensions | |
| OLD | NEW |