Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc |
=================================================================== |
--- chrome/browser/ui/content_settings/content_setting_bubble_model.cc (revision 127082) |
+++ chrome/browser/ui/content_settings/content_setting_bubble_model.cc (working copy) |
@@ -14,8 +14,8 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h" |
+#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
-#include "chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/content_settings.h" |
@@ -57,12 +57,12 @@ |
class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel { |
public: |
- ContentSettingTitleAndLinkModel(Delegate* delegate, |
+ ContentSettingTitleAndLinkModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingBubbleModel(tab_contents, profile, content_type), |
- delegate_(delegate) { |
+ browser_(browser) { |
// Notifications do not have a bubble. |
DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
SetBlockedResources(); |
@@ -71,7 +71,7 @@ |
} |
virtual ~ContentSettingTitleAndLinkModel() {} |
- Delegate* delegate() const { return delegate_; } |
+ Browser* browser() const { return browser_; } |
private: |
void SetBlockedResources() { |
@@ -131,22 +131,22 @@ |
} |
virtual void OnManageLinkClicked() { |
- if (delegate_) |
- delegate_->ShowContentSettingsPage(content_type()); |
+ if (browser_) |
+ browser_->ShowContentSettingsPage(content_type()); |
} |
- Delegate* delegate_; |
+ Browser* browser_; |
}; |
class ContentSettingTitleLinkAndCustomModel |
: public ContentSettingTitleAndLinkModel { |
public: |
- ContentSettingTitleLinkAndCustomModel(Delegate* delegate, |
+ ContentSettingTitleLinkAndCustomModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingTitleAndLinkModel( |
- delegate, tab_contents, profile, content_type) { |
+ browser, tab_contents, profile, content_type) { |
SetCustomLink(); |
} |
@@ -171,11 +171,11 @@ |
class ContentSettingSingleRadioGroup |
: public ContentSettingTitleLinkAndCustomModel { |
public: |
- ContentSettingSingleRadioGroup(Delegate* delegate, |
+ ContentSettingSingleRadioGroup(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
- : ContentSettingTitleLinkAndCustomModel(delegate, tab_contents, profile, |
+ : ContentSettingTitleLinkAndCustomModel(browser, tab_contents, profile, |
content_type), |
block_setting_(CONTENT_SETTING_BLOCK), |
selected_item_(0) { |
@@ -333,12 +333,12 @@ |
class ContentSettingCookiesBubbleModel : public ContentSettingSingleRadioGroup { |
public: |
- ContentSettingCookiesBubbleModel(Delegate* delegate, |
+ ContentSettingCookiesBubbleModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingSingleRadioGroup( |
- delegate, tab_contents, profile, content_type) { |
+ browser, tab_contents, profile, content_type) { |
DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); |
set_custom_link_enabled(true); |
} |
@@ -360,18 +360,18 @@ |
content::Source<TabSpecificContentSettings>( |
tab_contents()->content_settings()), |
content::NotificationService::NoDetails()); |
- delegate()->ShowCollectedCookiesDialog(tab_contents()); |
+ browser()->ShowCollectedCookiesDialog(tab_contents()); |
} |
}; |
class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { |
public: |
- ContentSettingPluginBubbleModel(Delegate* delegate, |
+ ContentSettingPluginBubbleModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingSingleRadioGroup( |
- delegate, tab_contents, profile, content_type) { |
+ browser, tab_contents, profile, content_type) { |
DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS); |
set_custom_link_enabled(tab_contents && tab_contents->content_settings()-> |
load_plugins_link_enabled()); |
@@ -393,12 +393,12 @@ |
class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { |
public: |
- ContentSettingPopupBubbleModel(Delegate* delegate, |
+ ContentSettingPopupBubbleModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingSingleRadioGroup( |
- delegate, tab_contents, profile, content_type) { |
+ browser, tab_contents, profile, content_type) { |
SetPopups(); |
} |
@@ -435,12 +435,12 @@ |
class ContentSettingDomainListBubbleModel |
: public ContentSettingTitleAndLinkModel { |
public: |
- ContentSettingDomainListBubbleModel(Delegate* delegate, |
+ ContentSettingDomainListBubbleModel(Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) |
: ContentSettingTitleAndLinkModel( |
- delegate, tab_contents, profile, content_type) { |
+ browser, tab_contents, profile, content_type) { |
DCHECK_EQ(CONTENT_SETTINGS_TYPE_GEOLOCATION, content_type) << |
"SetDomains currently only supports geolocation content type"; |
SetDomainsAndCustomLink(); |
@@ -511,27 +511,27 @@ |
// static |
ContentSettingBubbleModel* |
ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
- Delegate* delegate, |
+ Browser* browser, |
TabContentsWrapper* tab_contents, |
Profile* profile, |
ContentSettingsType content_type) { |
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { |
- return new ContentSettingCookiesBubbleModel(delegate, tab_contents, profile, |
+ return new ContentSettingCookiesBubbleModel(browser, tab_contents, profile, |
content_type); |
} |
if (content_type == CONTENT_SETTINGS_TYPE_POPUPS) { |
- return new ContentSettingPopupBubbleModel(delegate, tab_contents, profile, |
+ return new ContentSettingPopupBubbleModel(browser, tab_contents, profile, |
content_type); |
} |
if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { |
- return new ContentSettingDomainListBubbleModel(delegate, tab_contents, |
+ return new ContentSettingDomainListBubbleModel(browser, tab_contents, |
profile, content_type); |
} |
if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS) { |
- return new ContentSettingPluginBubbleModel(delegate, tab_contents, profile, |
+ return new ContentSettingPluginBubbleModel(browser, tab_contents, profile, |
content_type); |
} |
- return new ContentSettingSingleRadioGroup(delegate, tab_contents, profile, |
+ return new ContentSettingSingleRadioGroup(browser, tab_contents, profile, |
content_type); |
} |