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

Side by Side Diff: chrome/browser/chromeos/login/language_switch_menu.cc

Issue 7977025: aura: Make 'ui' buildable without gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « build/linux/system.gyp ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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/login/language_switch_menu.h" 5 #include "chrome/browser/chromeos/login/language_switch_menu.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chromeos/cros/cros_library.h" 11 #include "chrome/browser/chromeos/cros/cros_library.h"
12 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 12 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
13 #include "chrome/browser/chromeos/input_method/input_method_util.h" 13 #include "chrome/browser/chromeos/input_method/input_method_util.h"
14 #include "chrome/browser/chromeos/language_preferences.h" 14 #include "chrome/browser/chromeos/language_preferences.h"
15 #include "chrome/browser/chromeos/login/language_list.h" 15 #include "chrome/browser/chromeos/login/language_list.h"
16 #include "chrome/browser/chromeos/login/ownership_service.h" 16 #include "chrome/browser/chromeos/login/ownership_service.h"
17 #include "chrome/browser/chromeos/login/screen_observer.h" 17 #include "chrome/browser/chromeos/login/screen_observer.h"
18 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "grit/platform_locale_settings.h" 21 #include "grit/platform_locale_settings.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/gfx/platform_font_gtk.h" 24 #include "ui/gfx/platform_font_pango.h"
25 #include "views/controls/button/menu_button.h" 25 #include "views/controls/button/menu_button.h"
26 #include "views/controls/menu/menu_item_view.h" 26 #include "views/controls/menu/menu_item_view.h"
27 #include "views/controls/menu/menu_runner.h" 27 #include "views/controls/menu/menu_runner.h"
28 #include "views/controls/menu/submenu_view.h" 28 #include "views/controls/menu/submenu_view.h"
29 #include "views/widget/widget.h" 29 #include "views/widget/widget.h"
30 30
31 namespace { 31 namespace {
32 32
33 const int kLanguageMainMenuSize = 5; 33 const int kLanguageMainMenuSize = 5;
34 // TODO(glotov): need to specify the list as a part of the image customization. 34 // TODO(glotov): need to specify the list as a part of the image customization.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // gtkrc overrides the styles from previous ones when there is a conflict, but 132 // gtkrc overrides the styles from previous ones when there is a conflict, but
133 // styles that are added and not conflicted will not be overridden. So far 133 // styles that are added and not conflicted will not be overridden. So far
134 // there are no locales with such a thing; if there are then this solution 134 // there are no locales with such a thing; if there are then this solution
135 // will not work. 135 // will not work.
136 if (!gtkrc.empty()) 136 if (!gtkrc.empty())
137 gtk_rc_parse_string(gtkrc.c_str()); 137 gtk_rc_parse_string(gtkrc.c_str());
138 else 138 else
139 gtk_rc_parse("/etc/gtk-2.0/gtkrc"); 139 gtk_rc_parse("/etc/gtk-2.0/gtkrc");
140 140
141 // Switch the font. 141 // Switch the font.
142 gfx::PlatformFontGtk::ReloadDefaultFont(); 142 gfx::PlatformFontPango::ReloadDefaultFont();
143 ResourceBundle::GetSharedInstance().ReloadFonts(); 143 ResourceBundle::GetSharedInstance().ReloadFonts();
144 } 144 }
145 145
146 // static 146 // static
147 void LanguageSwitchMenu::SwitchLanguageAndEnableKeyboardLayouts( 147 void LanguageSwitchMenu::SwitchLanguageAndEnableKeyboardLayouts(
148 const std::string& locale) { 148 const std::string& locale) {
149 if (SwitchLanguage(locale)) { 149 if (SwitchLanguage(locale)) {
150 // If we have switched the locale, enable the keyboard layouts that 150 // If we have switched the locale, enable the keyboard layouts that
151 // are necessary for the new locale. Change the current input method 151 // are necessary for the new locale. Change the current input method
152 // to the hardware keyboard layout since the input method currently in 152 // to the hardware keyboard layout since the input method currently in
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 g_browser_process->local_state()->SetString( 193 g_browser_process->local_state()->SetString(
194 prefs::kApplicationLocale, locale); 194 prefs::kApplicationLocale, locale);
195 g_browser_process->local_state()->ScheduleSavePersistentPrefs(); 195 g_browser_process->local_state()->ScheduleSavePersistentPrefs();
196 InitLanguageMenu(); 196 InitLanguageMenu();
197 197
198 // Update all view hierarchies that the locale has changed. 198 // Update all view hierarchies that the locale has changed.
199 views::Widget::NotifyLocaleChanged(); 199 views::Widget::NotifyLocaleChanged();
200 } 200 }
201 201
202 } // namespace chromeos 202 } // namespace chromeos
OLDNEW
« no previous file with comments | « build/linux/system.gyp ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698