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..3dc599509285136337afc6e214496b45fbe993bf |
| --- /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 "base/memory/ptr_util.h" |
| +#include "chrome/browser/profiles/profiles_state.h" |
| +#include "chrome/common/extensions/api/tabs.h" |
| +#include "url/gurl.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). |
| + tab->url = base::MakeUnique<std::string>(GURL(*tab->url).GetOrigin().spec()); |
|
Andrew T Wilson (Slow)
2017/04/25 15:11:09
Quick question - what happens if the URL in the ta
Devlin
2017/04/25 15:19:22
These values come from us populating a dictionary
|
| +} |
| + |
| +} // namespace extensions |