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

Side by Side Diff: ui/base/ime/chromeos/input_method_descriptor.cc

Issue 1871743003: ui: Add out-of-line copy ctors for complex classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 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 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 "ui/base/ime/chromeos/input_method_descriptor.h" 5 #include "ui/base/ime/chromeos/input_method_descriptor.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 16 matching lines...) Expand all
27 : id_(id), 27 : id_(id),
28 name_(name), 28 name_(name),
29 keyboard_layouts_(keyboard_layouts), 29 keyboard_layouts_(keyboard_layouts),
30 language_codes_(language_codes), 30 language_codes_(language_codes),
31 indicator_(indicator), 31 indicator_(indicator),
32 is_login_keyboard_(is_login_keyboard), 32 is_login_keyboard_(is_login_keyboard),
33 options_page_url_(options_page_url), 33 options_page_url_(options_page_url),
34 input_view_url_(input_view_url) { 34 input_view_url_(input_view_url) {
35 } 35 }
36 36
37 InputMethodDescriptor::InputMethodDescriptor(
38 const InputMethodDescriptor& other) = default;
39
37 std::string InputMethodDescriptor::GetPreferredKeyboardLayout() const { 40 std::string InputMethodDescriptor::GetPreferredKeyboardLayout() const {
38 // TODO(nona): Investigate better way to guess the preferred layout 41 // TODO(nona): Investigate better way to guess the preferred layout
39 // http://crbug.com/170601. 42 // http://crbug.com/170601.
40 return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0]; 43 return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0];
41 } 44 }
42 45
43 std::string InputMethodDescriptor::GetIndicator() const { 46 std::string InputMethodDescriptor::GetIndicator() const {
44 // If indicator is empty, use the first two character in its preferred 47 // If indicator is empty, use the first two character in its preferred
45 // keyboard layout or language code. 48 // keyboard layout or language code.
46 if (indicator_.empty()) { 49 if (indicator_.empty()) {
47 if (extension_ime_util::IsKeyboardLayoutExtension(id_)) { 50 if (extension_ime_util::IsKeyboardLayoutExtension(id_)) {
48 return base::ToUpperASCII(GetPreferredKeyboardLayout().substr(0, 2)); 51 return base::ToUpperASCII(GetPreferredKeyboardLayout().substr(0, 2));
49 } 52 }
50 DCHECK(language_codes_.size() > 0); 53 DCHECK(language_codes_.size() > 0);
51 return base::ToUpperASCII(language_codes_[0].substr(0, 2)); 54 return base::ToUpperASCII(language_codes_[0].substr(0, 2));
52 } 55 }
53 return indicator_; 56 return indicator_;
54 } 57 }
55 58
56 InputMethodDescriptor::InputMethodDescriptor() { 59 InputMethodDescriptor::InputMethodDescriptor() {
57 } 60 }
58 61
59 InputMethodDescriptor::~InputMethodDescriptor() { 62 InputMethodDescriptor::~InputMethodDescriptor() {
60 } 63 }
61 64
62 } // namespace input_method 65 } // namespace input_method
63 } // namespace chromeos 66 } // namespace chromeos
OLDNEW
« no previous file with comments | « ui/base/ime/chromeos/input_method_descriptor.h ('k') | ui/base/ime/chromeos/input_method_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698