summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 10:03:07 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 10:03:07 +0000
commit0d146bf5d1b7302156e986970125dc98ae7a3d28 (patch)
tree676c7e41784fe3b0fd4a8a3c2c23b28a92b3d065
parentc3eb467660b82675bd69a3f59241e9083bab8edb (diff)
downloadchromium_src-0d146bf5d1b7302156e986970125dc98ae7a3d28.zip
chromium_src-0d146bf5d1b7302156e986970125dc98ae7a3d28.tar.gz
chromium_src-0d146bf5d1b7302156e986970125dc98ae7a3d28.tar.bz2
If host part of an URL cannot be parsed, use the spec in content bubbles
BUG=64374 TEST=as described in bug Review URL: http://codereview.chromium.org/6529023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75087 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/content_setting_bubble_model.cc3
-rw-r--r--chrome/browser/content_setting_bubble_model_unittest.cc11
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/content_setting_bubble_model.cc b/chrome/browser/content_setting_bubble_model.cc
index c2f058c..8a4c6b6 100644
--- a/chrome/browser/content_setting_bubble_model.cc
+++ b/chrome/browser/content_setting_bubble_model.cc
@@ -197,6 +197,9 @@ class ContentSettingSingleRadioGroup
&display_host_wide, NULL, NULL);
std::string display_host(WideToUTF8(display_host_wide));
+ if (display_host.empty())
+ display_host = url.spec();
+
const std::set<std::string>& resources =
bubble_content().resource_identifiers;
diff --git a/chrome/browser/content_setting_bubble_model_unittest.cc b/chrome/browser/content_setting_bubble_model_unittest.cc
index 00f38c8..0a45cd6 100644
--- a/chrome/browser/content_setting_bubble_model_unittest.cc
+++ b/chrome/browser/content_setting_bubble_model_unittest.cc
@@ -185,3 +185,14 @@ TEST_F(ContentSettingBubbleModelTest, Geolocation) {
setting_map->SetDefaultContentSetting(CONTENT_SETTING_BLOCK);
CheckGeolocationBubble(2, true, false);
}
+
+TEST_F(ContentSettingBubbleModelTest, FileURL) {
+ std::string file_url("file:///tmp/test.html");
+ NavigateAndCommit(GURL(file_url));
+ scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ contents(), profile_.get(), CONTENT_SETTINGS_TYPE_IMAGES));
+ std::string title =
+ content_setting_bubble_model->bubble_content().radio_group.radio_items[0];
+ ASSERT_NE(std::string::npos, title.find(file_url));
+}