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

Unified Diff: chrome/browser/chromeos/login/message_bubble.h

Issue 8557005: Rebase the MessageBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. 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 | « no previous file | chrome/browser/chromeos/login/message_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/message_bubble.h
diff --git a/chrome/browser/chromeos/login/message_bubble.h b/chrome/browser/chromeos/login/message_bubble.h
index 7d572515a19be6003efb174cced644e7f561a501..2b28ac66cc80ab174165472b9d368834a0725de6 100644
--- a/chrome/browser/chromeos/login/message_bubble.h
+++ b/chrome/browser/chromeos/login/message_bubble.h
@@ -10,81 +10,47 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/ui/views/bubble/bubble.h"
+#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/link_listener.h"
-#include "views/view.h"
-
-#if defined(TOOLKIT_USES_GTK)
-#include "ui/views/widget/native_widget_gtk.h"
-#endif
class SkBitmap;
namespace views {
class ImageButton;
-class ImageView;
-class Label;
}
namespace chromeos {
-class MessageBubbleDelegate : public BubbleDelegate {
+class MessageBubbleLinkListener {
public:
- // Called when the user clicked on help link.
- // |index| identifies which link was clicked if there's more than one.
+ // Called when the user clicks on help link.
+ // |index| identifies which link was clicked in case there's more than one.
virtual void OnLinkActivated(size_t index) = 0;
};
// MessageBubble is used to show error and info messages on OOBE screens.
-class MessageBubble : public Bubble,
+class MessageBubble : public views::BubbleDelegateView,
public views::ButtonListener,
public views::LinkListener {
public:
- // Create and show bubble. position_relative_to must be in screen coordinates.
- // |links| is an optional vector of links texts.
- static MessageBubble* Show(views::Widget* parent,
- const gfx::Rect& position_relative_to,
- views::BubbleBorder::ArrowLocation arrow_location,
- SkBitmap* image,
- const std::wstring& text,
- const std::wstring& help,
- MessageBubbleDelegate* delegate);
-
- // Create and show bubble. position_relative_to must be in screen coordinates.
- // |links| is an optional vector of links texts.
- static MessageBubble* ShowWithLinks(
- views::Widget* parent,
- const gfx::Rect& position_relative_to,
- views::BubbleBorder::ArrowLocation arrow_location,
- SkBitmap* image,
- const std::wstring& text,
- const std::vector<std::wstring>& links,
- MessageBubbleDelegate* delegate);
-
- // Create and show bubble which does not grab pointer. This creates
- // a TYPE_CHILD NativeWidgetGtk and |position_relative_to| must be in parent's
- // coordinates.
- static MessageBubble* ShowNoGrab(
- views::Widget* parent,
- const gfx::Rect& position_relative_to,
- views::BubbleBorder::ArrowLocation arrow_location,
- SkBitmap* image,
- const std::wstring& text,
- const std::wstring& help,
- MessageBubbleDelegate* delegate);
-
- // Overridden from NativeWidgetGtk/NativeWidgetViews.
- virtual void Close() OVERRIDE;
-
-#if defined(TOOLKIT_USES_GTK)
- virtual gboolean OnButtonPress(GtkWidget* widget,
- GdkEventButton* event) OVERRIDE;
-#endif
+ MessageBubble(views::View* anchor_view,
+ views::BubbleBorder::ArrowLocation arrow_location,
+ SkBitmap* image,
+ const string16& text,
+ const std::vector<string16>& links);
- protected:
virtual ~MessageBubble();
+ void set_link_listener(MessageBubbleLinkListener* link_listener) {
+ link_listener_ = link_listener;
+ }
+
+ protected:
+
+ // Overridden from views::BubbleDelegateView:
+ virtual void Init() OVERRIDE;
+
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const views::Event& event) OVERRIDE;
@@ -92,28 +58,12 @@ class MessageBubble : public Bubble,
// Overridden from views::LinkListener:
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
-#if defined(TOOLKIT_USES_GTK)
- // Overridden from NativeWidgetGtk.
- virtual void OnActiveChanged() OVERRIDE;
- virtual void SetMouseCapture() OVERRIDE;
-#endif
-
private:
- MessageBubble(views::Widget::InitParams::Type type,
- views::Widget* parent,
- SkBitmap* image,
- const std::wstring& text,
- const std::vector<std::wstring>& links,
- bool grab_enabled,
- MessageBubbleDelegate* delegate);
-
- views::Widget* parent_;
- views::ImageView* icon_;
- views::Label* text_;
+ SkBitmap* image_;
+ string16 text_;
views::ImageButton* close_button_;
std::vector<views::Link*> help_links_;
- MessageBubbleDelegate* message_delegate_;
- bool grab_enabled_;
+ MessageBubbleLinkListener* link_listener_;
DISALLOW_COPY_AND_ASSIGN(MessageBubble);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/message_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698