summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/browser/chromeos/setting_level_bubble.cc7
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc226
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h59
-rw-r--r--chrome/browser/ui/views/browser_dialogs.h7
-rw-r--r--chrome/browser/ui/views/critical_notification_bubble_view.cc4
-rw-r--r--chrome/browser/ui/views/critical_notification_bubble_view.h2
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc11
-rw-r--r--chrome/browser/ui/views/location_bar/star_view.cc11
-rw-r--r--chrome/browser/ui/views/location_bar/star_view.h9
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc7
11 files changed, 104 insertions, 242 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index f48ebf8..cc2d66c 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6686,9 +6686,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
<!-- bookmark info bubble messages -->
- <message name="IDS_BOOKMARK_BUBBLE_ADD_BOOKMARK" desc="Accessible title of the bubble before bookmarking something">
- Add Bookmark
- </message>
<message name="IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED" desc="Title of the bubble after bookmarking something">
Bookmark Added!
</message>
diff --git a/chrome/browser/chromeos/setting_level_bubble.cc b/chrome/browser/chromeos/setting_level_bubble.cc
index daaf3b2..650c252 100644
--- a/chrome/browser/chromeos/setting_level_bubble.cc
+++ b/chrome/browser/chromeos/setting_level_bubble.cc
@@ -138,9 +138,7 @@ gfx::Point SettingLevelBubbleDelegateView::GetAnchorPoint() {
SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView(
views::Widget* parent)
- : BubbleDelegateView(gfx::Point(),
- views::BubbleBorder::FLOAT,
- SK_ColorWHITE),
+ : BubbleDelegateView(NULL, views::BubbleBorder::FLOAT, SK_ColorWHITE),
parent_(parent),
view_(NULL) {
set_close_on_esc(false);
@@ -238,8 +236,7 @@ SettingLevelBubbleView* SettingLevelBubble::CreateView() {
views::Widget* parent = GetToplevelWidget();
SettingLevelBubbleDelegateView* delegate =
new SettingLevelBubbleDelegateView(parent);
- views::Widget* widget =
- views::BubbleDelegateView::CreateBubble(delegate, parent);
+ views::Widget* widget = views::BubbleDelegateView::CreateBubble(delegate);
widget->AddObserver(this);
#if !defined(USE_AURA)
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index b9a76af..dead673 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/views/bubble/bubble.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
@@ -23,20 +22,14 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/canvas.h"
#include "views/controls/button/text_button.h"
#include "views/controls/label.h"
#include "views/controls/link.h"
#include "views/controls/textfield/textfield.h"
#include "views/events/event.h"
-#include "views/focus/focus_manager.h"
#include "views/layout/grid_layout.h"
#include "views/layout/layout_constants.h"
-#include "views/window/client_view.h"
-
-#if defined(TOOLKIT_USES_GTK)
-#include "views/widget/native_widget_gtk.h"
-#endif
+#include "views/widget/widget.h"
using views::ColumnSet;
using views::GridLayout;
@@ -50,18 +43,18 @@ static const int kTitlePadding = 4;
// of the field's left edge.
static const int kMinimumFieldSize = 180;
+// TODO(msw): Get color from theme/window color.
+static const SkColor kColor = SK_ColorWHITE;
+
// Declared in browser_dialogs.h so callers don't have to depend on our header.
namespace browser {
-void ShowBookmarkBubbleView(views::Widget* parent,
- const gfx::Rect& bounds,
- BubbleDelegate* delegate,
+void ShowBookmarkBubbleView(views::View* anchor_view,
Profile* profile,
const GURL& url,
bool newly_bookmarked) {
- BookmarkBubbleView::Show(parent, bounds, delegate, profile, url,
- newly_bookmarked);
+ BookmarkBubbleView::ShowBubble(anchor_view, profile, url, newly_bookmarked);
}
void HideBookmarkBubbleView() {
@@ -79,30 +72,20 @@ bool IsBookmarkBubbleViewShowing() {
BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL;
// static
-void BookmarkBubbleView::Show(views::Widget* parent,
- const gfx::Rect& bounds,
- BubbleDelegate* delegate,
- Profile* profile,
- const GURL& url,
- bool newly_bookmarked) {
+void BookmarkBubbleView::ShowBubble(views::View* anchor_view,
+ Profile* profile,
+ const GURL& url,
+ bool newly_bookmarked) {
if (IsShowing())
return;
- bookmark_bubble_ = new BookmarkBubbleView(delegate, profile, url,
- newly_bookmarked);
- Bubble* bubble = Bubble::Show(
- parent, bounds, views::BubbleBorder::TOP_RIGHT,
- views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bookmark_bubble_,
- bookmark_bubble_);
- // |bubble_| can be set to NULL in BubbleClosing when we close the bubble
- // asynchronously. However, that can happen during the Show call above if the
- // window loses activation while we are getting to ready to show the bubble,
- // so we must check to make sure we still have a valid bubble before
- // proceeding.
- if (!bookmark_bubble_)
- return;
- bookmark_bubble_->set_bubble(bubble);
- bubble->SizeToContents();
+ bookmark_bubble_ =
+ new BookmarkBubbleView(anchor_view, profile, url, newly_bookmarked);
+ views::BubbleDelegateView::CreateBubble(bookmark_bubble_);
+ bookmark_bubble_->Show();
+ // Select the entire title textfield contents when the bubble is first shown.
+ bookmark_bubble_->title_tf_->SelectAll();
+
GURL url_ptr(url);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN,
@@ -117,7 +100,7 @@ bool BookmarkBubbleView::IsShowing() {
void BookmarkBubbleView::Hide() {
if (IsShowing())
- bookmark_bubble_->Close();
+ bookmark_bubble_->GetWidget()->Close();
}
BookmarkBubbleView::~BookmarkBubbleView() {
@@ -131,54 +114,47 @@ BookmarkBubbleView::~BookmarkBubbleView() {
}
}
-void BookmarkBubbleView::BubbleShown() {
- DCHECK(GetWidget());
- GetFocusManager()->RegisterAccelerator(
- views::Accelerator(ui::VKEY_RETURN, false, false, false), this);
+views::View* BookmarkBubbleView::GetInitiallyFocusedView() {
+ return title_tf_;
+}
- title_tf_->RequestFocus();
- title_tf_->SelectAll();
+gfx::Point BookmarkBubbleView::GetAnchorPoint() {
+ // Compensate for some built-in padding in the star image.
+ return BubbleDelegateView::GetAnchorPoint().Subtract(gfx::Point(0, 5));
}
-bool BookmarkBubbleView::AcceleratorPressed(
- const views::Accelerator& accelerator) {
- if (accelerator.key_code() != ui::VKEY_RETURN)
- return false;
+void BookmarkBubbleView::WindowClosing() {
+ // We have to reset |bubble_| here, not in our destructor, because we'll be
+ // destroyed asynchronously and the shown state will be checked before then.
+ DCHECK(bookmark_bubble_ == this);
+ bookmark_bubble_ = NULL;
- if (edit_button_->HasFocus())
- HandleButtonPressed(edit_button_);
- else
- HandleButtonPressed(close_button_);
- return true;
-}
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN,
+ content::Source<Profile>(profile_->GetOriginalProfile()),
+ content::NotificationService::NoDetails());
+ }
-void BookmarkBubbleView::ViewHierarchyChanged(bool is_add,
- views::View* parent,
- views::View* child) {
- if (is_add && child == this)
- Init();
-}
+bool BookmarkBubbleView::AcceleratorPressed(
+ const views::Accelerator& accelerator) {
+ if (accelerator.key_code() == ui::VKEY_RETURN) {
+ if (edit_button_->HasFocus())
+ HandleButtonPressed(edit_button_);
+ else
+ HandleButtonPressed(close_button_);
+ return true;
+ } else if (accelerator.key_code() == ui::VKEY_ESCAPE) {
+ remove_bookmark_ = newly_bookmarked_;
+ apply_edits_ = false;
+ }
-BookmarkBubbleView::BookmarkBubbleView(BubbleDelegate* delegate,
- Profile* profile,
- const GURL& url,
- bool newly_bookmarked)
- : delegate_(delegate),
- profile_(profile),
- url_(url),
- newly_bookmarked_(newly_bookmarked),
- parent_model_(
- profile_->GetBookmarkModel(),
- profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url)),
- remove_bookmark_(false),
- apply_edits_(true) {
+ return BubbleDelegateView::AcceleratorPressed(accelerator);
}
void BookmarkBubbleView::Init() {
remove_link_ = new views::Link(l10n_util::GetStringUTF16(
IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK));
remove_link_->set_listener(this);
- remove_link_->SetBackgroundColor(Bubble::kBackgroundColor);
edit_button_ = new views::NativeTextButton(
this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS));
@@ -189,7 +165,6 @@ void BookmarkBubbleView::Init() {
views::Label* combobox_label = new views::Label(
l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT));
- combobox_label->SetBackgroundColor(Bubble::kBackgroundColor);
parent_combobox_ = new views::Combobox(&parent_model_);
parent_combobox_->SetSelectedItem(parent_model_.node_parent_index());
@@ -202,7 +177,6 @@ void BookmarkBubbleView::Init() {
IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK));
title_label->SetFont(
ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont));
- title_label->SetBackgroundColor(Bubble::kBackgroundColor);
title_label->SetEnabledColor(SkColorSetRGB(6, 45, 117));
GridLayout* layout = new GridLayout(this);
@@ -245,7 +219,6 @@ void BookmarkBubbleView::Init() {
layout->StartRow(0, 2);
views::Label* label = new views::Label(
l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_TITLE_TEXT));
- label->SetBackgroundColor(Bubble::kBackgroundColor);
layout->AddView(label);
title_tf_ = new views::Textfield();
title_tf_->SetText(GetTitle());
@@ -261,6 +234,23 @@ void BookmarkBubbleView::Init() {
layout->StartRow(0, 3);
layout->AddView(edit_button_);
layout->AddView(close_button_);
+
+ AddAccelerator(views::Accelerator(ui::VKEY_RETURN, 0));
+}
+
+BookmarkBubbleView::BookmarkBubbleView(views::View* anchor_view,
+ Profile* profile,
+ const GURL& url,
+ bool newly_bookmarked)
+ : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT, kColor),
+ profile_(profile),
+ url_(url),
+ newly_bookmarked_(newly_bookmarked),
+ parent_model_(
+ profile_->GetBookmarkModel(),
+ profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url)),
+ remove_bookmark_(false),
+ apply_edits_(true) {
}
string16 BookmarkBubbleView::GetTitle() {
@@ -286,9 +276,7 @@ void BookmarkBubbleView::LinkClicked(views::Link* source, int event_flags) {
// Set this so we remove the bookmark after the window closes.
remove_bookmark_ = true;
apply_edits_ = false;
-
- bubble_->set_fade_away_on_close(true);
- Close();
+ StartFade(false);
}
void BookmarkBubbleView::ItemChanged(views::Combobox* combobox,
@@ -297,97 +285,32 @@ void BookmarkBubbleView::ItemChanged(views::Combobox* combobox,
if (new_index + 1 == parent_model_.GetItemCount()) {
UserMetrics::RecordAction(
UserMetricsAction("BookmarkBubble_EditFromCombobox"));
-
ShowEditor();
- return;
}
}
-void BookmarkBubbleView::BubbleClosing(Bubble* bubble,
- bool closed_by_escape) {
- if (closed_by_escape) {
- remove_bookmark_ = newly_bookmarked_;
- apply_edits_ = false;
- }
-
- // We have to reset |bubble_| here, not in our destructor, because we'll be
- // destroyed asynchronously and the shown state will be checked before then.
- DCHECK(bookmark_bubble_ == this);
- bookmark_bubble_ = NULL;
-
- if (delegate_)
- delegate_->BubbleClosing(bubble, closed_by_escape);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN,
- content::Source<Profile>(profile_->GetOriginalProfile()),
- content::NotificationService::NoDetails());
-}
-
-bool BookmarkBubbleView::CloseOnEscape() {
- return delegate_ ? delegate_->CloseOnEscape() : true;
-}
-
-bool BookmarkBubbleView::FadeInOnShow() {
- return false;
-}
-
-string16 BookmarkBubbleView::GetAccessibleName() {
- return l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_ADD_BOOKMARK);
-}
-
-void BookmarkBubbleView::Close() {
- ApplyEdits();
- GetWidget()->Close();
-}
-
void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) {
if (sender == edit_button_) {
UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
- bubble_->set_fade_away_on_close(true);
ShowEditor();
} else {
- DCHECK(sender == close_button_);
- bubble_->set_fade_away_on_close(true);
- Close();
+ DCHECK_EQ(sender, close_button_);
+ StartFade(false);
}
- // WARNING: we've most likely been deleted when CloseWindow returns.
}
void BookmarkBubbleView::ShowEditor() {
const BookmarkNode* node =
profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_);
+ views::Widget* parent = anchor_view()->GetWidget();
+ Profile* profile = profile_;
+ ApplyEdits();
+ GetWidget()->Close();
-#if defined(USE_AURA)
- NOTIMPLEMENTED();
- gfx::NativeView parent = NULL;
-#elif defined(OS_WIN)
- // Parent the editor to our root ancestor (not the root we're in, as that
- // is the info bubble and will close shortly).
- HWND parent = GetAncestor(GetWidget()->GetNativeView(), GA_ROOTOWNER);
-
- // We're about to show the bookmark editor. When the bookmark editor closes
- // we want the browser to become active. NativeWidgetWin::Hide() does a hide
- // in a such way that activation isn't changed, which means when we close
- // Windows gets confused as to who it should give active status to. We
- // explicitly hide the bookmark bubble window in such a way that activation
- // status changes. That way, when the editor closes, activation is properly
- // restored to the browser.
- ShowWindow(GetWidget()->GetNativeView(), SW_HIDE);
-#elif defined(TOOLKIT_USES_GTK)
- gfx::NativeWindow parent = GTK_WINDOW(
- static_cast<views::NativeWidgetGtk*>(GetWidget()->native_widget())->
- GetTransientParent());
-#endif
-
- // Even though we just hid the window, we need to invoke Close to schedule
- // the delete and all that.
- Close();
-
- if (node) {
- BookmarkEditor::Show(parent, profile_,
+ if (node)
+ BookmarkEditor::Show(parent->GetNativeWindow(), profile,
BookmarkEditor::EditDetails::EditNode(node),
BookmarkEditor::SHOW_TREE);
- }
}
void BookmarkBubbleView::ApplyEdits() {
@@ -404,8 +327,7 @@ void BookmarkBubbleView::ApplyEdits() {
UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
}
// Last index means 'Choose another folder...'
- if (parent_combobox_->selected_item() <
- parent_model_.GetItemCount() - 1) {
+ if (parent_combobox_->selected_item() < parent_model_.GetItemCount() - 1) {
const BookmarkNode* new_parent =
parent_model_.GetNodeAt(parent_combobox_->selected_item());
if (new_parent != node->parent()) {
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
index 38c15e2..c134802 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
@@ -8,19 +8,14 @@
#include "base/string16.h"
#include "chrome/browser/bookmarks/recently_used_folders_combo_model.h"
-#include "chrome/browser/ui/views/bubble/bubble.h"
#include "googleurl/src/gurl.h"
-#include "ui/gfx/rect.h"
+#include "views/bubble/bubble_delegate.h"
#include "views/controls/button/button.h"
#include "views/controls/combobox/combobox.h"
#include "views/controls/link_listener.h"
-#include "views/view.h"
class Profile;
-class BookmarkModel;
-class BookmarkNode;
-
namespace views {
class TextButton;
class Textfield;
@@ -30,18 +25,15 @@ class Textfield;
// Bubble. BookmarkBubbleView provides views for unstarring and editing the
// bookmark it is created with. Don't create a BookmarkBubbleView directly,
// instead use the static Show method.
-class BookmarkBubbleView : public views::View,
+class BookmarkBubbleView : public views::BubbleDelegateView,
public views::LinkListener,
public views::ButtonListener,
- public views::Combobox::Listener,
- public BubbleDelegate {
+ public views::Combobox::Listener {
public:
- static void Show(views::Widget* widget,
- const gfx::Rect& bounds,
- BubbleDelegate* delegate,
- Profile* profile,
- const GURL& url,
- bool newly_bookmarked);
+ static void ShowBubble(views::View* anchor_view,
+ Profile* profile,
+ const GURL& url,
+ bool newly_bookmarked);
static bool IsShowing();
@@ -49,25 +41,27 @@ class BookmarkBubbleView : public views::View,
virtual ~BookmarkBubbleView();
- void set_bubble(Bubble* bubble) { bubble_ = bubble; }
+ // views::BubbleDelegateView methods.
+ virtual views::View* GetInitiallyFocusedView() OVERRIDE;
+ virtual gfx::Point GetAnchorPoint() OVERRIDE;
+
+ // views::WidgetDelegate method.
+ virtual void WindowClosing() OVERRIDE;
- // Override to close on return.
+ // views::View method.
virtual bool AcceleratorPressed(
const views::Accelerator& accelerator) OVERRIDE;
- virtual void ViewHierarchyChanged(
- bool is_add, View* parent, View* child) OVERRIDE;
+ protected:
+ // views::BubbleDelegateView method.
+ virtual void Init() OVERRIDE;
private:
// Creates a BookmarkBubbleView.
- // |title| is the title of the page. If newly_bookmarked is false, title is
- // ignored and the title of the bookmark is fetched from the database.
- BookmarkBubbleView(BubbleDelegate* delegate,
+ BookmarkBubbleView(views::View* anchor_view,
Profile* profile,
const GURL& url,
bool newly_bookmarked);
- // Creates the child views.
- void Init();
// Returns the title to display.
string16 GetTitle();
@@ -85,17 +79,6 @@ class BookmarkBubbleView : public views::View,
int prev_index,
int new_index) OVERRIDE;
- // BubbleDelegate methods. These forward to the BubbleDelegate supplied in the
- // constructor as well as sending out the necessary notification.
- virtual void BubbleShown() OVERRIDE;
- virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE;
- virtual bool CloseOnEscape() OVERRIDE;
- virtual bool FadeInOnShow() OVERRIDE;
- virtual string16 GetAccessibleName() OVERRIDE;
-
- // Closes the bubble.
- void Close();
-
// Handle the message when the user presses a button.
void HandleButtonPressed(views::Button* sender);
@@ -108,12 +91,6 @@ class BookmarkBubbleView : public views::View,
// The bookmark bubble, if we're showing one.
static BookmarkBubbleView* bookmark_bubble_;
- // The Bubble showing us.
- Bubble* bubble_;
-
- // Delegate for the bubble, may be null.
- BubbleDelegate* delegate_;
-
// The profile.
Profile* profile_;
diff --git a/chrome/browser/ui/views/browser_dialogs.h b/chrome/browser/ui/views/browser_dialogs.h
index f0f0026..2d3492c 100644
--- a/chrome/browser/ui/views/browser_dialogs.h
+++ b/chrome/browser/ui/views/browser_dialogs.h
@@ -22,27 +22,24 @@ class EditSearchEngineControllerDelegate;
class Extension;
class FindBar;
class GURL;
-class BubbleDelegate;
class Profile;
class TabContents;
class TabContentsWrapper;
class TemplateURL;
namespace gfx {
-class Rect;
class Size;
}
namespace views {
+class View;
class Widget;
}
namespace browser {
// Shows or hides the global bookmark bubble for the star button.
-void ShowBookmarkBubbleView(views::Widget* parent,
- const gfx::Rect& bounds,
- BubbleDelegate* delegate,
+void ShowBookmarkBubbleView(views::View* anchor_view,
Profile* profile,
const GURL& url,
bool newly_bookmarked);
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.cc b/chrome/browser/ui/views/critical_notification_bubble_view.cc
index 63f00c2..ca95103 100644
--- a/chrome/browser/ui/views/critical_notification_bubble_view.cc
+++ b/chrome/browser/ui/views/critical_notification_bubble_view.cc
@@ -47,8 +47,8 @@ const int kRefreshBubbleEvery = 1000; // Millisecond.
// CriticalNotificationBubbleView
CriticalNotificationBubbleView::CriticalNotificationBubbleView(
- const gfx::Point& anchor_point)
- : BubbleDelegateView(anchor_point,
+ views::View* anchor_view)
+ : BubbleDelegateView(anchor_view,
views::BubbleBorder::TOP_RIGHT,
SK_ColorWHITE) {
set_close_on_deactivate(false);
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.h b/chrome/browser/ui/views/critical_notification_bubble_view.h
index 79c9826..0e886a8 100644
--- a/chrome/browser/ui/views/critical_notification_bubble_view.h
+++ b/chrome/browser/ui/views/critical_notification_bubble_view.h
@@ -18,7 +18,7 @@ class NativeTextButton;
class CriticalNotificationBubbleView : public views::BubbleDelegateView,
public views::ButtonListener {
public:
- explicit CriticalNotificationBubbleView(const gfx::Point& anchor_point);
+ explicit CriticalNotificationBubbleView(views::View* anchor_view);
virtual ~CriticalNotificationBubbleView();
// views::ButtonListener overrides:
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 4856ab5..4cdc1c2 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -56,7 +56,6 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/skia_util.h"
-#include "views/bubble/bubble_border.h"
#include "views/controls/label.h"
#include "views/controls/textfield/native_textfield_views.h"
#include "views/drag_utils.h"
@@ -395,14 +394,8 @@ void LocationBarView::SetStarToggled(bool on) {
}
void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) {
- gfx::Rect screen_bounds(star_view_->GetImageBounds());
- // Compensate for some built-in padding in the Star image.
- screen_bounds.Inset(1, 1, 1, 2);
- gfx::Point origin(screen_bounds.origin());
- views::View::ConvertPointToScreen(star_view_, &origin);
- screen_bounds.set_origin(origin);
- browser::ShowBookmarkBubbleView(GetWidget(), screen_bounds, star_view_,
- browser_->profile(), url, newly_bookmarked);
+ browser::ShowBookmarkBubbleView(star_view_, browser_->profile(), url,
+ newly_bookmarked);
}
gfx::Point LocationBarView::GetLocationEntryOrigin() const {
diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc
index 6a0cd14..75a3b15 100644
--- a/chrome/browser/ui/views/location_bar/star_view.cc
+++ b/chrome/browser/ui/views/location_bar/star_view.cc
@@ -65,14 +65,3 @@ bool StarView::OnKeyPressed(const views::KeyEvent& event) {
}
return false;
}
-
-void StarView::BubbleClosing(Bubble* bubble, bool closed_by_escape) {
-}
-
-bool StarView::CloseOnEscape() {
- return true;
-}
-
-bool StarView::FadeInOnShow() {
- return false;
-}
diff --git a/chrome/browser/ui/views/location_bar/star_view.h b/chrome/browser/ui/views/location_bar/star_view.h
index eacf925..7125287 100644
--- a/chrome/browser/ui/views/location_bar/star_view.h
+++ b/chrome/browser/ui/views/location_bar/star_view.h
@@ -6,18 +6,16 @@
#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_
#pragma once
-#include "chrome/browser/ui/views/bubble/bubble.h"
#include "views/controls/image_view.h"
class CommandUpdater;
-class Bubble;
namespace views {
class KeyEvent;
class MouseEvent;
}
-class StarView : public views::ImageView, public BubbleDelegate {
+class StarView : public views::ImageView {
public:
explicit StarView(CommandUpdater* command_updater);
virtual ~StarView();
@@ -34,11 +32,6 @@ class StarView : public views::ImageView, public BubbleDelegate {
virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
- // BubbleDelegate overrides:
- virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE;
- virtual bool CloseOnEscape() OVERRIDE;
- virtual bool FadeInOnShow() OVERRIDE;
-
// The CommandUpdater for the Browser object that owns the location bar.
CommandUpdater* command_updater_;
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 6da0619..79f226a 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -729,12 +729,9 @@ void ToolbarView::LoadImages() {
void ToolbarView::ShowCriticalNotification() {
#if defined(OS_WIN)
- gfx::Point screen_loc(app_menu_->width() / 2, app_menu_->height());
- views::View::ConvertPointToScreen(app_menu_, &screen_loc);
-
CriticalNotificationBubbleView* bubble_delegate =
- new CriticalNotificationBubbleView(screen_loc);
- views::BubbleDelegateView::CreateBubble(bubble_delegate, GetWidget());
+ new CriticalNotificationBubbleView(app_menu_);
+ views::BubbleDelegateView::CreateBubble(bubble_delegate);
bubble_delegate->StartFade(true);
#endif
}