summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/location_bar
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 22:20:35 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 22:20:35 +0000
commit9a9a9e2c6904c534fb2d529f5e3a331549f4bf00 (patch)
treeff9a3ddb7badd3d0c4e9489df6a4d14e531a1594 /chrome/browser/ui/views/location_bar
parentd4905e2e68cb434f9b3cbea9726eeaf23b1ecb00 (diff)
downloadchromium_src-9a9a9e2c6904c534fb2d529f5e3a331549f4bf00.zip
chromium_src-9a9a9e2c6904c534fb2d529f5e3a331549f4bf00.tar.gz
chromium_src-9a9a9e2c6904c534fb2d529f5e3a331549f4bf00.tar.bz2
Remove the last content settings include from content.
BUG=76793 Review URL: http://codereview.chromium.org/7011045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/location_bar')
-rw-r--r--chrome/browser/ui/views/location_bar/content_setting_image_view.cc3
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc20
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.h9
3 files changed, 18 insertions, 14 deletions
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index b3932b5..d0e589d 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -145,7 +145,8 @@ void ContentSettingImageView::OnMouseReleased(const views::MouseEvent& event) {
ContentSettingBubbleContents* bubble_contents =
new ContentSettingBubbleContents(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
- tab_contents, profile_, content_settings_type),
+ parent_->browser(), tab_contents, profile_,
+ content_settings_type),
profile_, tab_contents->tab_contents());
bubble_ = Bubble::Show(GetWidget(), screen_bounds, BubbleBorder::TOP_RIGHT,
bubble_contents, this);
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 35eb89d..75049e0 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/browser_dialogs.h"
@@ -98,12 +99,12 @@ static const int kNormalModeBackgroundImages[] = {
// LocationBarView -----------------------------------------------------------
LocationBarView::LocationBarView(Profile* profile,
- CommandUpdater* command_updater,
+ Browser* browser,
ToolbarModel* model,
Delegate* delegate,
Mode mode)
: profile_(profile),
- command_updater_(command_updater),
+ browser_(browser),
model_(model),
delegate_(delegate),
disposition_(CURRENT_TAB),
@@ -170,11 +171,11 @@ void LocationBarView::Init() {
// View container for URL edit field.
#if defined(OS_WIN)
location_entry_.reset(new OmniboxViewWin(font_, this, model_, this,
- GetWidget()->GetNativeView(), profile_, command_updater_,
+ GetWidget()->GetNativeView(), profile_, browser_->command_updater(),
mode_ == POPUP, this));
#else
location_entry_.reset(OmniboxViewGtk::Create(this, model_, profile_,
- command_updater_, mode_ == POPUP, this));
+ browser_->command_updater(), mode_ == POPUP, this));
#endif
location_entry_view_ = location_entry_->AddToView(this);
@@ -205,7 +206,7 @@ void LocationBarView::Init() {
// The star is not visible in popups and in the app launcher.
if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) {
- star_view_ = new StarView(command_updater_);
+ star_view_ = new StarView(browser_->command_updater());
AddChildView(star_view_);
star_view_->SetVisible(true);
}
@@ -282,7 +283,8 @@ void LocationBarView::SetAnimationOffset(int offset) {
void LocationBarView::Update(const TabContents* tab_for_state_restoring) {
bool star_enabled = star_view_ && !model_->input_in_progress() &&
edit_bookmarks_enabled_.GetValue();
- command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled);
+ browser_->command_updater()->UpdateCommandEnabled(
+ IDC_BOOKMARK_PAGE, star_enabled);
if (star_view_)
star_view_->SetVisible(star_enabled);
RefreshContentSettingViews();
@@ -790,16 +792,16 @@ void LocationBarView::OnAutocompleteAccept(
disposition_ = disposition;
transition_ = transition;
- if (command_updater_) {
+ if (browser_->command_updater()) {
if (!alternate_nav_url.is_valid()) {
- command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL);
+ browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL);
} else {
AlternateNavURLFetcher* fetcher =
new AlternateNavURLFetcher(alternate_nav_url);
// The AlternateNavURLFetcher will listen for the pending navigation
// notification that will be issued as a result of the "open URL." It
// will automatically install itself into that navigation controller.
- command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL);
+ browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL);
if (fetcher->state() == AlternateNavURLFetcher::NOT_STARTED) {
// I'm not sure this should be reachable, but I'm not also sure enough
// that it shouldn't to stick in a NOTREACHED(). In any case, this is
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h
index 6947520..072868e 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.h
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -31,7 +31,7 @@
#include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h"
#endif
-class CommandUpdater;
+class Browser;
class ContentSettingImageView;
class EVBubbleView;
class ExtensionAction;
@@ -118,7 +118,7 @@ class LocationBarView : public LocationBar,
};
LocationBarView(Profile* profile,
- CommandUpdater* command_updater,
+ Browser* browser,
ToolbarModel* model,
Delegate* delegate,
Mode mode);
@@ -142,6 +142,7 @@ class LocationBarView : public LocationBar,
void SetProfile(Profile* profile);
Profile* profile() const { return profile_; }
+ Browser* browser() const { return browser_; }
// Sets |preview_enabled| for the PageAction View associated with this
// |page_action|. If |preview_enabled| is true, the view will display the
@@ -343,8 +344,8 @@ class LocationBarView : public LocationBar,
scoped_ptr<OmniboxView> location_entry_;
#endif
- // The CommandUpdater for the Browser object that corresponds to this View.
- CommandUpdater* command_updater_;
+ // The Browser object that corresponds to this View.
+ Browser* browser_;
// The model.
ToolbarModel* model_;