OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/options/languages_page_gtk.h" | 5 #include "chrome/browser/gtk/options/languages_page_gtk.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 const int kWrapWidth = 475; | 28 const int kWrapWidth = 475; |
29 | 29 |
30 GtkWidget* NewComboboxFromModel(ComboboxModel* model) { | 30 GtkWidget* NewComboboxFromModel(ComboboxModel* model) { |
31 GtkWidget* combobox = gtk_combo_box_new_text(); | 31 GtkWidget* combobox = gtk_combo_box_new_text(); |
32 int count = model->GetItemCount(); | 32 int count = model->GetItemCount(); |
33 for (int i = 0; i < count; ++i) | 33 for (int i = 0; i < count; ++i) |
34 gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), | 34 gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), |
35 WideToUTF8(model->GetItemAt(i)).c_str()); | 35 UTF16ToUTF8(model->GetItemAt(i)).c_str()); |
36 return combobox; | 36 return combobox; |
37 } | 37 } |
38 | 38 |
39 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
40 // AddLanguageDialog | 40 // AddLanguageDialog |
41 | 41 |
42 class AddLanguageDialog { | 42 class AddLanguageDialog { |
43 public: | 43 public: |
44 AddLanguageDialog(Profile* profile, LanguagesPageGtk* delegate); | 44 AddLanguageDialog(Profile* profile, LanguagesPageGtk* delegate); |
45 virtual ~AddLanguageDialog() {} | 45 virtual ~AddLanguageDialog() {} |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 OnAddLanguage(language); | 443 OnAddLanguage(language); |
444 spellcheck_language_added_ = language; | 444 spellcheck_language_added_ = language; |
445 } else { | 445 } else { |
446 spellcheck_language_added_ = ""; | 446 spellcheck_language_added_ = ""; |
447 } | 447 } |
448 | 448 |
449 UserMetricsRecordAction(UserMetricsAction("Options_DictionaryLanguage"), | 449 UserMetricsRecordAction(UserMetricsAction("Options_DictionaryLanguage"), |
450 profile()->GetPrefs()); | 450 profile()->GetPrefs()); |
451 dictionary_language_.SetValue(language); | 451 dictionary_language_.SetValue(language); |
452 } | 452 } |
OLD | NEW |