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

Unified Diff: content/renderer/android/renderer_date_time_picker.cc

Issue 1474533004: Merge the DateTimeSuggestionBuilder in to the file that uses it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « content/content_renderer.gypi ('k') | content/renderer/date_time_suggestion_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/android/renderer_date_time_picker.cc
diff --git a/content/renderer/android/renderer_date_time_picker.cc b/content/renderer/android/renderer_date_time_picker.cc
index 15b833289d5f394e42e1315cead30b0c33b70992..7319c4401d1113abe64fa2481c8ebe0660c77080 100644
--- a/content/renderer/android/renderer_date_time_picker.cc
+++ b/content/renderer/android/renderer_date_time_picker.cc
@@ -5,18 +5,33 @@
#include "content/renderer/android/renderer_date_time_picker.h"
#include "base/strings/string_util.h"
+#include "content/common/date_time_suggestion.h"
#include "content/common/view_messages.h"
-#include "content/renderer/date_time_suggestion_builder.h"
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/web/WebDateTimeChooserCompletion.h"
#include "third_party/WebKit/public/web/WebDateTimeChooserParams.h"
#include "third_party/WebKit/public/web/WebDateTimeInputType.h"
+#include "third_party/WebKit/public/web/WebDateTimeSuggestion.h"
#include "ui/base/ime/text_input_type.h"
using blink::WebString;
namespace content {
+namespace {
+
+// Converts a |blink::WebDateTimeSuggestion| structure to |DateTimeSuggestion|.
+DateTimeSuggestion ToDateTimeSuggestion(
+ const blink::WebDateTimeSuggestion& suggestion) {
+ DateTimeSuggestion result;
+ result.value = suggestion.value;
+ result.localized_value = suggestion.localizedValue;
+ result.label = suggestion.label;
+ return result;
+}
+
+} // namespace
+
static ui::TextInputType ToTextInputType(int type) {
switch (type) {
case blink::WebDateTimeInputTypeDate:
@@ -64,7 +79,7 @@ bool RendererDateTimePicker::Open() {
message.step = chooser_params_.step;
for (size_t i = 0; i < chooser_params_.suggestions.size(); i++) {
message.suggestions.push_back(
- DateTimeSuggestionBuilder::Build(chooser_params_.suggestions[i]));
+ ToDateTimeSuggestion(chooser_params_.suggestions[i]));
}
Send(new ViewHostMsg_OpenDateTimeDialog(routing_id(), message));
return true;
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/date_time_suggestion_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698