1 // Copyright 2013 The Chromium Authors. 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 "chromeos/ime/input_method_descriptor.h"
9 #include "base/logging.h"
10 #include "base/strings/string_split.h"
11 #include "googleurl/src/gurl.h"
14 namespace input_method
{
16 InputMethodDescriptor::InputMethodDescriptor(
17 const std::string
& id
,
18 const std::string
& name
,
19 const std::vector
<std::string
>& keyboard_layouts
,
20 const std::string
& language_code
,
21 const GURL
& options_page_url
)
24 keyboard_layouts_(keyboard_layouts
),
25 language_code_(language_code
),
26 options_page_url_(options_page_url
) {
29 std::string
InputMethodDescriptor::GetPreferredKeyboardLayout() const {
30 // TODO(nona): Investigate better way to guess the preferred layout
31 // http://crbug.com/170601.
32 return keyboard_layouts_
.empty() ? "us" : keyboard_layouts_
[0];
35 InputMethodDescriptor::InputMethodDescriptor() {
38 InputMethodDescriptor::~InputMethodDescriptor() {
41 } // namespace input_method
42 } // namespace chromeos