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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 2236663002: Add origin of settings reset request to feedback reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Vasilii's comments Created 4 years, 4 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/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 639d5b2cb93b32b163a02154077598946e5bb364..d4a64a714d9c102fbb8147e06ebfcbda34206b1c 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -30,6 +30,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
@@ -525,6 +526,13 @@ std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine(
if (!url.is_valid())
continue;
+#if !defined(OS_CHROMEOS)
+ static const char kCctHash[] = "#CCT";
+ const std::string reset_settings_url =
+ base::StringPrintf("%s%s", chrome::kChromeUISettingsURL,
+ chrome::kResetProfileSettingsSubPage);
+#endif
Dan Beam 2016/08/19 02:06:41 can you just put this in the #else block below and
alito 2016/08/20 03:01:25 Done.
+
ChildProcessSecurityPolicy* policy =
ChildProcessSecurityPolicy::GetInstance();
if (policy->IsWebSafeScheme(url.scheme()) ||
@@ -536,10 +544,9 @@ std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine(
base::CompareCase::SENSITIVE) ||
#else
// Exposed for external cleaners to offer a settings reset to the
- // user. So the URL must match exactly, without any param or prefix.
- (url.spec() ==
- std::string(chrome::kChromeUISettingsURL) +
- chrome::kResetProfileSettingsSubPage) ||
+ // user. The allowed URLs must match exactly.
+ (url.spec() == reset_settings_url) ||
+ (url.spec() == reset_settings_url + kCctHash) ||
#endif
Dan Beam 2016/08/19 02:06:41 let's just make a bool outside of this #if and set
alito 2016/08/20 03:01:25 Done. Also made the CCT-specific url windows-only
(url.spec().compare(url::kAboutBlankURL) == 0)) {
urls.push_back(url);

Powered by Google App Engine
This is Rietveld 408576698