| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> // std::find | 7 #include <algorithm> // std::find |
| 8 | 8 |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 } | 603 } |
| 604 | 604 |
| 605 if (layout.empty()) | 605 if (layout.empty()) |
| 606 return; | 606 return; |
| 607 | 607 |
| 608 std::vector<std::string> layouts; | 608 std::vector<std::string> layouts; |
| 609 base::SplitString(layout, ',', &layouts); | 609 base::SplitString(layout, ',', &layouts); |
| 610 manager_->MigrateInputMethods(&layouts); | 610 manager_->MigrateInputMethods(&layouts); |
| 611 | 611 |
| 612 PrefService* prefs = g_browser_process->local_state(); | 612 PrefService* prefs = g_browser_process->local_state(); |
| 613 prefs->SetString(prefs::kHardwareKeyboardLayout, | 613 prefs->SetString(prefs::kHardwareKeyboardLayout, JoinString(layouts, ",")); |
| 614 base::JoinString(layouts, ",")); | |
| 615 | 614 |
| 616 // This asks the file thread to save the prefs (i.e. doesn't block). | 615 // This asks the file thread to save the prefs (i.e. doesn't block). |
| 617 // The latest values of Local State reside in memory so we can safely | 616 // The latest values of Local State reside in memory so we can safely |
| 618 // get the value of kHardwareKeyboardLayout even if the data is not | 617 // get the value of kHardwareKeyboardLayout even if the data is not |
| 619 // yet saved to disk. | 618 // yet saved to disk. |
| 620 prefs->CommitPendingWrite(); | 619 prefs->CommitPendingWrite(); |
| 621 | 620 |
| 622 manager_->util_.UpdateHardwareLayoutCache(); | 621 manager_->util_.UpdateHardwareLayoutCache(); |
| 623 | 622 |
| 624 EnableLoginLayouts(locale, layouts); | 623 EnableLoginLayouts(locale, layouts); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 if (candidate_window_controller_.get()) | 1166 if (candidate_window_controller_.get()) |
| 1168 return; | 1167 return; |
| 1169 | 1168 |
| 1170 candidate_window_controller_.reset( | 1169 candidate_window_controller_.reset( |
| 1171 CandidateWindowController::CreateCandidateWindowController()); | 1170 CandidateWindowController::CreateCandidateWindowController()); |
| 1172 candidate_window_controller_->AddObserver(this); | 1171 candidate_window_controller_->AddObserver(this); |
| 1173 } | 1172 } |
| 1174 | 1173 |
| 1175 } // namespace input_method | 1174 } // namespace input_method |
| 1176 } // namespace chromeos | 1175 } // namespace chromeos |
| OLD | NEW |