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

Side by Side Diff: chrome/renderer/validation_message_agent.cc

Issue 14848002: Re-implement form validation message UI with native widgets (GTK) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/validation_message_agent.h" 5 #include "chrome/renderer/validation_message_agent.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "chrome/common/validation_message_messages.h" 8 #include "chrome/common/validation_message_messages.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
11 11
12 ValidationMessageAgent::ValidationMessageAgent(content::RenderView* render_view) 12 ValidationMessageAgent::ValidationMessageAgent(content::RenderView* render_view)
13 : content::RenderViewObserver(render_view) 13 : content::RenderViewObserver(render_view)
14 { 14 {
15 #if defined(OS_MACOSX) || defined(TOOLKIT_VIEWS) 15 #if !defined(OS_ANDROID)
16 // TODO(tkent): enable this for other platforms. 16 // TODO(tkent): enable this for Android. crbug.com/235721.
17 // crbug.com/235717, crbug.com/235721.
18 render_view->GetWebView()->setValidationMessageClient(this); 17 render_view->GetWebView()->setValidationMessageClient(this);
19 #endif 18 #endif
20 } 19 }
21 20
22 ValidationMessageAgent::~ValidationMessageAgent() {} 21 ValidationMessageAgent::~ValidationMessageAgent() {}
23 22
24 void ValidationMessageAgent::showValidationMessage( 23 void ValidationMessageAgent::showValidationMessage(
25 const WebKit::WebRect& anchor_in_screen, 24 const WebKit::WebRect& anchor_in_screen,
26 const WebKit::WebString& main_text, 25 const WebKit::WebString& main_text,
27 const WebKit::WebString& sub_text, 26 const WebKit::WebString& sub_text,
(...skipping 16 matching lines...) Expand all
44 } 43 }
45 44
46 Send(new ValidationMessageMsg_ShowValidationMessage( 45 Send(new ValidationMessageMsg_ShowValidationMessage(
47 routing_id(), anchor_in_screen, wrapped_main_text, wrapped_sub_text)); 46 routing_id(), anchor_in_screen, wrapped_main_text, wrapped_sub_text));
48 } 47 }
49 48
50 void ValidationMessageAgent::hideValidationMessage() { 49 void ValidationMessageAgent::hideValidationMessage() {
51 Send(new ValidationMessageMsg_HideValidationMessage()); 50 Send(new ValidationMessageMsg_HideValidationMessage());
52 } 51 }
53 52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698