Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 9703099: Revert 126959 - Re-factor location bar/toolbar code to get rid of the browser dependency. This CL i… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698