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

Unified Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 8603010: content settings bubble using new ui/views/bubble api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/content_setting_image_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/content_setting_image_view.cc
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 d6cebb22f4e1eb26464abed490f15ad6f92ef56c..9c790cf8dd1ad984da691a5139f5db02f082db0d 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
@@ -52,7 +52,6 @@ ContentSettingImageView::ContentSettingImageView(
ContentSettingImageModel::CreateContentSettingImageModel(
content_type)),
parent_(parent),
- bubble_(NULL),
animation_in_progress_(false),
text_size_(0),
visible_text_size_(0) {
@@ -60,8 +59,6 @@ ContentSettingImageView::ContentSettingImageView(
}
ContentSettingImageView::~ContentSettingImageView() {
- if (bubble_)
- bubble_->Close();
}
void ContentSettingImageView::UpdateFromTabContents(TabContents* tab_contents) {
@@ -131,28 +128,19 @@ void ContentSettingImageView::OnMouseReleased(const views::MouseEvent& event) {
if (!tab_contents)
return;
- gfx::Rect screen_bounds(GetImageBounds());
- gfx::Point origin(screen_bounds.origin());
- views::View::ConvertPointToScreen(this, &origin);
- screen_bounds.set_origin(origin);
Profile* profile = parent_->browser()->profile();
- ContentSettingBubbleContents* bubble_contents =
- new ContentSettingBubbleContents(
- ContentSettingBubbleModel::CreateContentSettingBubbleModel(
- parent_->browser(), tab_contents, profile,
- content_setting_image_model_->get_content_settings_type()),
- profile, tab_contents->tab_contents());
- bubble_ = Bubble::Show(GetWidget(), screen_bounds,
- views::BubbleBorder::TOP_RIGHT,
- views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR,
- bubble_contents, this);
- bubble_contents->set_bubble(bubble_);
-}
-
-void ContentSettingImageView::VisibilityChanged(View* starting_from,
- bool is_visible) {
- if (!is_visible && bubble_)
- bubble_->Close();
+ ContentSettingBubbleContents* bubble = new ContentSettingBubbleContents(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ parent_->browser(),
+ tab_contents,
+ profile,
+ content_setting_image_model_->get_content_settings_type()),
+ profile,
+ tab_contents->tab_contents(),
+ this,
+ views::BubbleBorder::TOP_RIGHT);
+ views::BubbleDelegateView::CreateBubble(bubble);
+ bubble->Show();
}
void ContentSettingImageView::OnPaint(gfx::Canvas* canvas) {
@@ -214,19 +202,6 @@ void ContentSettingImageView::OnPaintBackground(gfx::Canvas* canvas) {
kBoxCornerRadius, outer_paint);
}
-void ContentSettingImageView::BubbleClosing(Bubble* bubble,
- bool closed_by_escape) {
- bubble_ = NULL;
-}
-
-bool ContentSettingImageView::CloseOnEscape() {
- return true;
-}
-
-bool ContentSettingImageView::FadeInOnShow() {
- return false;
-}
-
void ContentSettingImageView::AnimateToState(double state) {
if (state >= 1.0) {
// Animaton is over, clear the variables.
« no previous file with comments | « chrome/browser/ui/views/location_bar/content_setting_image_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698