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

Unified Diff: chrome/browser/ui/views/validation_message_bubble_view.cc

Issue 16583005: Some improvement of validation message bubble UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 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
Index: chrome/browser/ui/views/validation_message_bubble_view.cc
diff --git a/chrome/browser/ui/views/validation_message_bubble_view.cc b/chrome/browser/ui/views/validation_message_bubble_view.cc
index 820d31e02f00b0dbb6fce6bd1e08698b2d9b1a62..bb3262ec8eb4c6528e7b802a715852f06b207879 100644
--- a/chrome/browser/ui/views/validation_message_bubble_view.cc
+++ b/chrome/browser/ui/views/validation_message_bubble_view.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/ui/validation_message_bubble.h"
#include "chrome/browser/ui/views/validation_message_bubble_delegate.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "ui/views/widget/widget.h"
namespace {
@@ -20,7 +22,16 @@ class ValidationMessageBubbleImpl
virtual ~ValidationMessageBubbleImpl() {
if (delegate_ != NULL)
- delegate_->Hide();
+ delegate_->Close();
+ }
+
+ virtual void SetPositionRelativeToAnchor(
+ content::RenderWidgetHost* widget_host,
+ const gfx::Rect& anchor_in_root_view) OVERRIDE {
+ if (!delegate_)
+ return;
+ delegate_->SetPositionRelativeToAnchor(anchor_in_root_view +
+ widget_host->GetView()->GetViewBounds().origin().OffsetFromOrigin());
}
// ValidationMessageBubbleDelegate::Observer override:
@@ -49,10 +60,12 @@ ValidationMessageBubbleImpl::ValidationMessageBubbleImpl(
namespace chrome {
scoped_ptr<ValidationMessageBubble> ValidationMessageBubble::CreateAndShow(
- content::RenderWidgetHost*,
- const gfx::Rect& anchor_in_screen,
+ content::RenderWidgetHost* widget_host,
+ const gfx::Rect& anchor_in_root_view,
const string16& main_text,
const string16& sub_text) {
+ const gfx::Rect anchor_in_screen = anchor_in_root_view
+ + widget_host->GetView()->GetViewBounds().origin().OffsetFromOrigin();
scoped_ptr<ValidationMessageBubble> bubble(
new ValidationMessageBubbleImpl(anchor_in_screen, main_text, sub_text));
return bubble.Pass();
« no previous file with comments | « chrome/browser/ui/views/validation_message_bubble_delegate.cc ('k') | chrome/browser/validation_message_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698