summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/browser_dialogs.h2
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.cc35
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.h5
-rw-r--r--chrome/browser/ui/views/dialog_stubs_gtk.cc6
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
6 files changed, 24 insertions, 30 deletions
diff --git a/chrome/browser/ui/views/browser_dialogs.h b/chrome/browser/ui/views/browser_dialogs.h
index a9575e53..f0f0026 100644
--- a/chrome/browser/ui/views/browser_dialogs.h
+++ b/chrome/browser/ui/views/browser_dialogs.h
@@ -83,7 +83,7 @@ void ShowRepostFormWarningDialog(gfx::NativeWindow parent_window,
// Shows the collected cookies dialog box.
void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window,
- TabContents* tab_contents);
+ TabContentsWrapper* tab_contents);
// Shows the create web app shortcut dialog box.
diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc
index 6780fa6..7aee53b 100644
--- a/chrome/browser/ui/views/collected_cookies_win.cc
+++ b/chrome/browser/ui/views/collected_cookies_win.cc
@@ -36,9 +36,9 @@ namespace browser {
// Declared in browser_dialogs.h so others don't have to depend on our header.
void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window,
- TabContents* tab_contents) {
+ TabContentsWrapper* wrapper) {
// Deletes itself on close.
- new CollectedCookiesWin(parent_window, tab_contents);
+ new CollectedCookiesWin(parent_window, wrapper);
}
} // namespace browser
@@ -164,8 +164,8 @@ class InfobarView : public views::View {
// CollectedCookiesWin, constructor and destructor:
CollectedCookiesWin::CollectedCookiesWin(gfx::NativeWindow parent_window,
- TabContents* tab_contents)
- : tab_contents_(tab_contents),
+ TabContentsWrapper* wrapper)
+ : wrapper_(wrapper),
allowed_label_(NULL),
blocked_label_(NULL),
allowed_cookies_tree_(NULL),
@@ -175,15 +175,13 @@ CollectedCookiesWin::CollectedCookiesWin(gfx::NativeWindow parent_window,
for_session_blocked_button_(NULL),
infobar_(NULL),
status_changed_(false) {
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)->
- content_settings();
+ TabSpecificContentSettings* content_settings = wrapper->content_settings();
registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN,
Source<TabSpecificContentSettings>(content_settings));
Init();
- window_ = new ConstrainedWindowViews(tab_contents_, this);
+ window_ = new ConstrainedWindowViews(wrapper->tab_contents(), this);
}
CollectedCookiesWin::~CollectedCookiesWin() {
@@ -238,9 +236,7 @@ void CollectedCookiesWin::Init() {
}
views::View* CollectedCookiesWin::CreateAllowedPane() {
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->
- content_settings();
+ TabSpecificContentSettings* content_settings = wrapper_->content_settings();
// Create the controls that go into the pane.
allowed_label_ = new views::Label(UTF16ToWide(l10n_util::GetStringUTF16(
@@ -288,12 +284,10 @@ views::View* CollectedCookiesWin::CreateAllowedPane() {
}
views::View* CollectedCookiesWin::CreateBlockedPane() {
- TabContentsWrapper* wrapper =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
- TabSpecificContentSettings* content_settings = wrapper->content_settings();
+ TabSpecificContentSettings* content_settings = wrapper_->content_settings();
HostContentSettingsMap* host_content_settings_map =
- wrapper->profile()->GetHostContentSettingsMap();
+ wrapper_->profile()->GetHostContentSettingsMap();
// Create the controls that go into the pane.
blocked_label_ = new views::Label(
@@ -379,9 +373,8 @@ void CollectedCookiesWin::DeleteDelegate() {
bool CollectedCookiesWin::Cancel() {
if (status_changed_) {
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->
- infobar_tab_helper()->AddInfoBar(
- new CollectedCookiesInfoBarDelegate(tab_contents_));
+ wrapper_->infobar_tab_helper()->AddInfoBar(
+ new CollectedCookiesInfoBarDelegate(wrapper_->tab_contents()));
}
return true;
@@ -486,8 +479,7 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
ContentSetting setting) {
CookieTreeOriginNode* origin_node =
static_cast<CookieTreeOriginNode*>(tree_view->GetSelectedNode());
- Profile* profile =
- Profile::FromBrowserContext(tab_contents_->browser_context());
+ Profile* profile = wrapper_->profile();
origin_node->CreateContentException(profile->GetHostContentSettingsMap(),
setting);
infobar_->UpdateVisibility(true, setting, origin_node->GetTitle());
@@ -500,7 +492,8 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
// window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the
// translation here until http://crbug.com/52851 is fixed.
POINT topleft = {bounds.x(), bounds.y()};
- MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1);
+ MapWindowPoints(HWND_DESKTOP, wrapper_->tab_contents()->GetNativeView(),
+ &topleft, 1);
gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize();
bounds.SetRect(topleft.x, topleft.y, size.width(), size.height());
GetWidget()->SetBounds(bounds);
diff --git a/chrome/browser/ui/views/collected_cookies_win.h b/chrome/browser/ui/views/collected_cookies_win.h
index ad74996..713222e 100644
--- a/chrome/browser/ui/views/collected_cookies_win.h
+++ b/chrome/browser/ui/views/collected_cookies_win.h
@@ -20,6 +20,7 @@ class CookieInfoView;
class CookiesTreeModel;
class InfobarView;
class TabContents;
+class TabContentsWrapper;
namespace views {
class Label;
@@ -41,7 +42,7 @@ class CollectedCookiesWin : public views::DialogDelegate,
public:
// Use BrowserWindow::ShowCollectedCookiesDialog to show.
CollectedCookiesWin(gfx::NativeWindow parent_window,
- TabContents* tab_contents);
+ TabContentsWrapper* wrapper);
// views::DialogDelegate:
virtual std::wstring GetWindowTitle() const OVERRIDE;
@@ -89,7 +90,7 @@ class CollectedCookiesWin : public views::DialogDelegate,
ConstrainedWindow* window_;
// The tab contents.
- TabContents* tab_contents_;
+ TabContentsWrapper* wrapper_;
// Assorted views.
views::Label* allowed_label_;
diff --git a/chrome/browser/ui/views/dialog_stubs_gtk.cc b/chrome/browser/ui/views/dialog_stubs_gtk.cc
index e0b70fc..bf0b5cb 100644
--- a/chrome/browser/ui/views/dialog_stubs_gtk.cc
+++ b/chrome/browser/ui/views/dialog_stubs_gtk.cc
@@ -41,11 +41,11 @@ void ShowRepostFormWarningDialog(gfx::NativeWindow parent_window,
}
void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window,
- TabContents* tab_contents) {
+ TabContentsWrapper* wrapper) {
#if defined(OS_CHROMEOS)
- CollectedCookiesUIDelegate::Show(tab_contents);
+ CollectedCookiesUIDelegate::Show(wrapper);
#else
- new CollectedCookiesGtk(GTK_WINDOW(parent_window), tab_contents);
+ new CollectedCookiesGtk(GTK_WINDOW(parent_window), wrapper);
#endif
}
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index d77882c..83646e1 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1142,8 +1142,8 @@ void BrowserView::ShowRepostFormWarningDialog(TabContents* tab_contents) {
browser::ShowRepostFormWarningDialog(GetNativeHandle(), tab_contents);
}
-void BrowserView::ShowCollectedCookiesDialog(TabContents* tab_contents) {
- browser::ShowCollectedCookiesDialog(GetNativeHandle(), tab_contents);
+void BrowserView::ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) {
+ browser::ShowCollectedCookiesDialog(GetNativeHandle(), wrapper);
}
void BrowserView::ShowThemeInstallBubble() {
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index ca1c525..8015321 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -307,7 +307,7 @@ class BrowserView : public BrowserBubbleHost,
virtual bool IsDownloadShelfVisible() const OVERRIDE;
virtual DownloadShelf* GetDownloadShelf() OVERRIDE;
virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) OVERRIDE;
- virtual void ShowCollectedCookiesDialog(TabContents* tab_contents) OVERRIDE;
+ virtual void ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) OVERRIDE;
virtual void ShowThemeInstallBubble() OVERRIDE;
virtual void ConfirmBrowserCloseWithPendingDownloads() OVERRIDE;
virtual gfx::NativeWindow ShowHTMLDialog(