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

Unified Diff: chrome/browser/validation_message_message_filter.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
« no previous file with comments | « chrome/browser/validation_message_message_filter.h ('k') | chrome/common/validation_message_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/validation_message_message_filter.cc
diff --git a/chrome/browser/validation_message_message_filter.cc b/chrome/browser/validation_message_message_filter.cc
index 99fe77c1609ffceb7c7f40ae1bba0f8afbb9f7a8..1d48232fb5648748444c58d58b41fffff4d45d01 100644
--- a/chrome/browser/validation_message_message_filter.cc
+++ b/chrome/browser/validation_message_message_filter.cc
@@ -44,6 +44,8 @@ bool ValidationMessageMessageFilter::OnMessageReceived(
OnShowValidationMessage)
IPC_MESSAGE_HANDLER(ValidationMessageMsg_HideValidationMessage,
OnHideValidationMessage)
+ IPC_MESSAGE_HANDLER(ValidationMessageMsg_MoveValidationMessage,
+ OnMoveValidationMessage)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -52,20 +54,31 @@ bool ValidationMessageMessageFilter::OnMessageReceived(
void ValidationMessageMessageFilter::OverrideThreadForMessage(
const IPC::Message& message, BrowserThread::ID* thread) {
if (message.type() == ValidationMessageMsg_ShowValidationMessage::ID
- || message.type() == ValidationMessageMsg_HideValidationMessage::ID)
+ || message.type() == ValidationMessageMsg_HideValidationMessage::ID
+ || message.type() == ValidationMessageMsg_MoveValidationMessage::ID)
*thread = BrowserThread::UI;
}
void ValidationMessageMessageFilter::OnShowValidationMessage(
- int route_id, const gfx::Rect& anchor_in_screen, const string16& main_text,
- const string16& sub_text) {
+ int route_id, const gfx::Rect& anchor_in_root_view,
+ const string16& main_text, const string16& sub_text) {
RenderProcessHost* process = RenderProcessHost::FromID(renderer_id_);
RenderWidgetHost* widget_host = process->GetRenderWidgetHostByID(route_id);
validation_message_bubble_ = chrome::ValidationMessageBubble::CreateAndShow(
- widget_host, anchor_in_screen, main_text, sub_text);
+ widget_host, anchor_in_root_view, main_text, sub_text);
}
void ValidationMessageMessageFilter::OnHideValidationMessage() {
validation_message_bubble_.reset();
}
+void ValidationMessageMessageFilter::OnMoveValidationMessage(
+ int route_id, const gfx::Rect& anchor_in_root_view) {
+ if (!validation_message_bubble_)
+ return;
+ RenderProcessHost* process = RenderProcessHost::FromID(renderer_id_);
+ RenderWidgetHost* widget_host = process->GetRenderWidgetHostByID(route_id);
+ validation_message_bubble_->SetPositionRelativeToAnchor(
+ widget_host, anchor_in_root_view);
+}
+
« no previous file with comments | « chrome/browser/validation_message_message_filter.h ('k') | chrome/common/validation_message_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698