Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: chrome/browser/chromeos/extensions/extension_tab_util_delegate_chromeos.cc

Issue 2830903003: PS - Scrub URL down to origin in Public Sessions (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698