summaryrefslogtreecommitdiffstats
path: root/chrome/common/content_settings_helper.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-04 20:06:37 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-04 20:06:37 +0000
commitd3dcc04318b8b55a5c3009251ea3686bdb46b4e8 (patch)
treeb2ebdd0fb259a5f4dec96dfd7074ecc243cdce20 /chrome/common/content_settings_helper.cc
parent468327f532d9d061ebbd4ea3baeea9b914cb352d (diff)
downloadchromium_src-d3dcc04318b8b55a5c3009251ea3686bdb46b4e8.zip
chromium_src-d3dcc04318b8b55a5c3009251ea3686bdb46b4e8.tar.gz
chromium_src-d3dcc04318b8b55a5c3009251ea3686bdb46b4e8.tar.bz2
[dom ui content settings] show geolocation exceptions in the table
This works with the following caveat: the view does not update as the model does. The view does update the model (when pressing remove), but not vice versa (the view is only updated once, when it is first opened). This is actually also true of the native dialog version. To fix this I will need to add an observer interface to the Geolocation settings map similar to the one in HostContentSettingsMap. I didn't use the GeolocationExceptionsTableModel because it doesn't seem helpful in this case, although I did copy some code from it. If we move to dom ui completely on all platforms, we can delete that file completely and the relevant parts will have migrated into ContentSettingsHandler. The GeolocationExceptionsTableModel allows for sorting, but I don't know if we care to keep that functionality as the mocks don't cover it, and if so it should probably be pageside. content_settings_handler is getting more unwieldy and will continue to do so, which motivated me to refactor a little and in particular to add better (or rather, any) comments to the header. I may eventually want to factor out even more functionality as new, special content types get added (plugins, notifications, geolocation, etc? are all non-standard). BUG=57457 TEST=manual Review URL: http://codereview.chromium.org/3520012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/content_settings_helper.cc')
-rw-r--r--chrome/common/content_settings_helper.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/common/content_settings_helper.cc b/chrome/common/content_settings_helper.cc
index 315b5e4..482a759 100644
--- a/chrome/common/content_settings_helper.cc
+++ b/chrome/common/content_settings_helper.cc
@@ -11,12 +11,16 @@
namespace content_settings_helper {
-std::wstring OriginToWString(const GURL& origin) {
- std::string port_component((origin.IntPort() != url_parse::PORT_UNSPECIFIED) ?
+std::string OriginToString(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);
+ return scheme_component + origin.host() + port_component;
+}
+
+std::wstring OriginToWString(const GURL& origin) {
+ return UTF8ToWide(OriginToString(origin));
}
} // namespace content_settings_helper