summaryrefslogtreecommitdiffstats
path: root/chrome/common/content_settings_helper.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-08-06 12:13:06 +0100
committerBen Murdoch <benm@google.com>2010-08-18 15:49:13 +0100
commit06741cbc25cd4227a9fba40dfd0273bfcc1a587a (patch)
treeca6f21dec86a8c4f6d3c50e78628c0cf31da0353 /chrome/common/content_settings_helper.cc
parentaa0bf16ed53445f227734aee4274c7aef056f032 (diff)
downloadexternal_chromium-06741cbc25cd4227a9fba40dfd0273bfcc1a587a.zip
external_chromium-06741cbc25cd4227a9fba40dfd0273bfcc1a587a.tar.gz
external_chromium-06741cbc25cd4227a9fba40dfd0273bfcc1a587a.tar.bz2
Add chrome/common @ 52593
Needed by autofill Change-Id: Ibfea9ab92382af0bd0cfc6e94d21e4baa4b9d896
Diffstat (limited to 'chrome/common/content_settings_helper.cc')
-rw-r--r--chrome/common/content_settings_helper.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/common/content_settings_helper.cc b/chrome/common/content_settings_helper.cc
new file mode 100644
index 0000000..315b5e4
--- /dev/null
+++ b/chrome/common/content_settings_helper.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2010 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/common/content_settings_helper.h"
+
+#include "base/utf_string_conversions.h"
+#include "base/string_piece.h"
+#include "chrome/common/url_constants.h"
+#include "googleurl/src/gurl.h"
+
+namespace content_settings_helper {
+
+std::wstring OriginToWString(const GURL& origin) {
+ std::string port_component((origin.IntPort() != url_parse::PORT_UNSPECIFIED) ?
+ ":" + origin.port() : "");
+ std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) ?
+ origin.scheme() + chrome::kStandardSchemeSeparator : "");
+ return UTF8ToWide(scheme_component + origin.host() + port_component);
+}
+
+} // namespace content_settings_helper