OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/candidate_window.h" | 5 #include "chrome/browser/chromeos/input_method/candidate_window.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "app/app_paths.h" | 11 #include "app/app_paths.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 if (ui_language_code.empty()) { | 43 if (ui_language_code.empty()) { |
44 ui_language_code = "en-US"; | 44 ui_language_code = "en-US"; |
45 } | 45 } |
46 ResourceBundle::InitSharedInstance(ui_language_code); | 46 ResourceBundle::InitSharedInstance(ui_language_code); |
47 | 47 |
48 // Change the UI font if needed. | 48 // Change the UI font if needed. |
49 const std::string font_name = | 49 const std::string font_name = |
50 l10n_util::GetStringUTF8(IDS_UI_FONT_FAMILY_CROS); | 50 l10n_util::GetStringUTF8(IDS_UI_FONT_FAMILY_CROS); |
51 // The font name should not be empty here, but just in case. | 51 // The font name should not be empty here, but just in case. |
52 if (font_name != "default" && !font_name.empty()) { | 52 if (font_name != "default" && !font_name.empty()) { |
53 // Don't use gtk_util::SetGtkFont() in chrome/browser/gtk not to | 53 // Don't use gtk_util::SetGtkFont() in chrome/browser/ui/gtk not to |
54 // introduce a dependency to it. | 54 // introduce a dependency to it. |
55 g_object_set(gtk_settings_get_default(), | 55 g_object_set(gtk_settings_get_default(), |
56 "gtk-font-name", font_name.c_str(), NULL); | 56 "gtk-font-name", font_name.c_str(), NULL); |
57 } | 57 } |
58 | 58 |
59 // Load libcros. | 59 // Load libcros. |
60 chrome::RegisterPathProvider(); // for libcros.so. | 60 chrome::RegisterPathProvider(); // for libcros.so. |
61 chromeos::CrosLibraryLoader lib_loader; | 61 chromeos::CrosLibraryLoader lib_loader; |
62 std::string error_string; | 62 std::string error_string; |
63 CHECK(lib_loader.Load(&error_string)) | 63 CHECK(lib_loader.Load(&error_string)) |
64 << "Failed to load libcros, " << error_string; | 64 << "Failed to load libcros, " << error_string; |
65 | 65 |
66 // Create the main message loop. | 66 // Create the main message loop. |
67 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | 67 MessageLoop main_message_loop(MessageLoop::TYPE_UI); |
68 | 68 |
69 // Create the candidate window controller. | 69 // Create the candidate window controller. |
70 chromeos::CandidateWindowController controller; | 70 chromeos::CandidateWindowController controller; |
71 if (!controller.Init()) { | 71 if (!controller.Init()) { |
72 return 1; | 72 return 1; |
73 } | 73 } |
74 | 74 |
75 // Start the main loop. | 75 // Start the main loop. |
76 views::AcceleratorHandler accelerator_handler; | 76 views::AcceleratorHandler accelerator_handler; |
77 MessageLoopForUI::current()->Run(&accelerator_handler); | 77 MessageLoopForUI::current()->Run(&accelerator_handler); |
78 | 78 |
79 return 0; | 79 return 0; |
80 } | 80 } |
OLD | NEW |