summaryrefslogtreecommitdiffstats
path: root/chrome/browser/content_setting_bubble_model.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 08:48:23 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 08:48:23 +0000
commitf8f69210d233566fddf71b57b093dd16da609ffc (patch)
tree9ed9ffcd865d65c11b11f73ea486efa79af13346 /chrome/browser/content_setting_bubble_model.cc
parent0af29d8cedd97d4604619dd4ab2b5e0a0805ecb1 (diff)
downloadchromium_src-f8f69210d233566fddf71b57b093dd16da609ffc.zip
chromium_src-f8f69210d233566fddf71b57b093dd16da609ffc.tar.gz
chromium_src-f8f69210d233566fddf71b57b093dd16da609ffc.tar.bz2
Display an info link in the blocked cookies info bubble.
The link will pop up a dialog that displays the cookies blocked and accessed by the current page. The XIB change adds a link-styled button (cell type HyperlinkButtonCell) below the title and above the horizontal line on the bubble with the text IDS_BLOCKED_COOKIES_INFO. The button action is hooked up to showMoreInfo: in the File's Owner. BUG=45230 TEST=none Review URL: http://codereview.chromium.org/2799012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_setting_bubble_model.cc')
-rw-r--r--chrome/browser/content_setting_bubble_model.cc38
1 files changed, 36 insertions, 2 deletions
diff --git a/chrome/browser/content_setting_bubble_model.cc b/chrome/browser/content_setting_bubble_model.cc
index f396cded..19587a5 100644
--- a/chrome/browser/content_setting_bubble_model.cc
+++ b/chrome/browser/content_setting_bubble_model.cc
@@ -66,6 +66,40 @@ class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel {
}
};
+class ContentSettingTitleLinkAndInfoModel
+ : public ContentSettingTitleAndLinkModel {
+ public:
+ ContentSettingTitleLinkAndInfoModel(TabContents* tab_contents,
+ Profile* profile,
+ ContentSettingsType content_type)
+ : ContentSettingTitleAndLinkModel(tab_contents, profile, content_type) {
+ SetInfoLink();
+ }
+
+ private:
+ void SetInfoLink() {
+ static const int kInfoIDs[] = {
+ IDS_BLOCKED_COOKIES_INFO,
+ 0, // Images do not have an info link.
+ 0, // Javascript doesn't have an info link.
+ 0, // Plugins do not have an info link.
+ 0, // Popups do not have an info link.
+ 0, // Geolocation does not have an info link.
+ 0, // Notifications do not have a bubble.
+ };
+ COMPILE_ASSERT(arraysize(kInfoIDs) == CONTENT_SETTINGS_NUM_TYPES,
+ Need_a_setting_for_every_content_settings_type);
+ if (kInfoIDs[content_type()])
+ set_info_link(l10n_util::GetStringUTF8(kInfoIDs[content_type()]));
+ }
+
+ virtual void OnInfoLinkClicked() {
+ DCHECK(content_type() == CONTENT_SETTINGS_TYPE_COOKIES);
+ // FIXME(jochen): show cookie info dialog.
+ }
+};
+
+
class ContentSettingSingleRadioGroup : public ContentSettingTitleAndLinkModel {
public:
ContentSettingSingleRadioGroup(TabContents* tab_contents, Profile* profile,
@@ -256,8 +290,8 @@ ContentSettingBubbleModel*
Profile* profile,
ContentSettingsType content_type) {
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) {
- return new ContentSettingTitleAndLinkModel(tab_contents, profile,
- content_type);
+ return new ContentSettingTitleLinkAndInfoModel(tab_contents, profile,
+ content_type);
}
if (content_type == CONTENT_SETTINGS_TYPE_POPUPS) {
return new ContentSettingPopupBubbleModel(tab_contents, profile,