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

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

Issue 2682004: MessageBubble which does not require separate window and does not grab input on mouse press event. (Closed)
Patch Set: moved HandleGrabBroke to protected section Created 10 years, 6 months 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/chromeos/login/message_bubble.h ('k') | chrome/browser/views/info_bubble.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/message_bubble.cc
diff --git a/chrome/browser/chromeos/login/message_bubble.cc b/chrome/browser/chromeos/login/message_bubble.cc
index 36071b5b6aafbc41fecb80a2f71e04ac5bd7db81..3c69f892e2c978e1c63ace3cab08d92d61456321 100644
--- a/chrome/browser/chromeos/login/message_bubble.cc
+++ b/chrome/browser/chromeos/login/message_bubble.cc
@@ -19,8 +19,11 @@ namespace chromeos {
static const int kBorderSize = 4;
static const int kMaxLabelWidth = 250;
-MessageBubble::MessageBubble(views::Widget* parent, SkBitmap* image,
- const std::wstring& text) : parent_(parent) {
+MessageBubble::MessageBubble(views::WidgetGtk::Type type, views::Widget* parent,
+ SkBitmap* image, const std::wstring& text, bool grab_enabled)
+ : InfoBubble(type),
+ parent_(parent),
+ grab_enabled_(grab_enabled) {
using views::GridLayout;
views::View* control_view = new views::View();
@@ -76,7 +79,24 @@ MessageBubble* MessageBubble::Show(views::Widget* parent,
const std::wstring& text,
InfoBubbleDelegate* delegate) {
// The bubble will be destroyed when it is closed.
- MessageBubble* bubble = new MessageBubble(parent, image, text);
+ MessageBubble* bubble = new MessageBubble(
+ views::WidgetGtk::TYPE_WINDOW, parent, image, text, true);
+ bubble->Init(parent, position_relative_to, arrow_location,
+ bubble->text_->GetParent(), delegate);
+ return bubble;
+}
+
+// static
+MessageBubble* MessageBubble::ShowNoGrab(
+ views::Widget* parent,
+ const gfx::Rect& position_relative_to,
+ BubbleBorder::ArrowLocation arrow_location,
+ SkBitmap* image,
+ const std::wstring& text,
+ InfoBubbleDelegate* delegate) {
+ // The bubble will be destroyed when it is closed.
+ MessageBubble* bubble = new MessageBubble(
+ views::WidgetGtk::TYPE_CHILD, parent, image, text, false);
bubble->Init(parent, position_relative_to, arrow_location,
bubble->text_->GetParent(), delegate);
return bubble;
@@ -91,6 +111,11 @@ void MessageBubble::IsActiveChanged() {
}
}
+void MessageBubble::DoGrab() {
+ if (grab_enabled_)
+ WidgetGtk::DoGrab();
+}
+
void MessageBubble::Close() {
parent_ = NULL;
InfoBubble::Close();
« no previous file with comments | « chrome/browser/chromeos/login/message_bubble.h ('k') | chrome/browser/views/info_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698