summaryrefslogtreecommitdiffstats
path: root/chromeos/ime/input_method_descriptor.cc
blob: c19ae8b9991092e49ba114b4a60477503607d7d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/ime/input_method_descriptor.h"

#include <sstream>

#include "base/logging.h"
#include "base/strings/string_split.h"
#include "googleurl/src/gurl.h"

namespace chromeos {
namespace input_method {

InputMethodDescriptor::InputMethodDescriptor(
    const std::string& id,
    const std::string& name,
    const std::vector<std::string>& keyboard_layouts,
    const std::string& language_code,
    const GURL& options_page_url)
    : id_(id),
      name_(name),
      keyboard_layouts_(keyboard_layouts),
      language_code_(language_code),
      options_page_url_(options_page_url) {
}

std::string InputMethodDescriptor::GetPreferredKeyboardLayout() const {
  // TODO(nona): Investigate better way to guess the preferred layout
  //             http://crbug.com/170601.
  return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0];
}

InputMethodDescriptor::InputMethodDescriptor() {
}

InputMethodDescriptor::~InputMethodDescriptor() {
}

}  // namespace input_method
}  // namespace chromeos