1 // Copyright 2019 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "wrt/src/browser/wrt_input_picker.h"
7 #include "content/browser/web_contents/web_contents_impl.h"
11 WRTInputPicker::WRTInputPicker(content::WebContents* web_contents,
12 Evas_Object* evas_object,
13 content::DateTimeChooserEfl* date_time_chooser)
14 : content::InputPickerBase(web_contents, evas_object, date_time_chooser),
15 web_contents_(web_contents) {}
17 void WRTInputPicker::ExecuteEditCommand(const char* command,
19 if (!command || !web_contents_)
22 content::WebContentsImpl* wc =
23 static_cast<content::WebContentsImpl*>(web_contents_);
27 if (auto* input_handler = wc->GetFocusedFrameWidgetInputHandler()) {
28 absl::optional<std::u16string> optional_value;
29 optional_value = value ? absl::make_optional(base::ASCIIToUTF16(value))
31 input_handler->ExecuteEditCommand(std::string(command), optional_value);