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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h

Issue 8368016: Rebase BookmarkBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only SelectAll on the title textfield when the buble is first shown. 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
Index: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
index 38c15e2f7f6ecf2967adcb8ff96ef6fb778a5e73..c1348027ac29ef5c6bded14fbe75718fbecd0480 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_;
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698