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

Side by Side Diff: chrome/browser/chromeos/login/language_switch_model.h

Issue 2853006: Added setting the locale on startup to the initial_locale attribute in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « no previous file | chrome/browser/chromeos/login/language_switch_model.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) 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "app/menus/simple_menu_model.h" 10 #include "app/menus/simple_menu_model.h"
(...skipping 23 matching lines...) Expand all
34 34
35 // Returns original width of the first level menu to be shown when called. 35 // Returns original width of the first level menu to be shown when called.
36 int GetFirstLevelMenuWidth() const; 36 int GetFirstLevelMenuWidth() const;
37 void SetFirstLevelMenuWidth(int width); 37 void SetFirstLevelMenuWidth(int width);
38 38
39 void set_menu_offset(int delta_x, int delta_y) { 39 void set_menu_offset(int delta_x, int delta_y) {
40 delta_x_ = delta_x; 40 delta_x_ = delta_x;
41 delta_y_ = delta_y; 41 delta_y_ = delta_y;
42 } 42 }
43 43
44 // Switches the current locale, saves the new locale in preferences.
45 static void SwitchLanguage(const std::string& locale);
46
44 private: 47 private:
45 // views::ViewMenuDelegate implementation. 48 // views::ViewMenuDelegate implementation.
46 virtual void RunMenu(views::View* source, const gfx::Point& pt); 49 virtual void RunMenu(views::View* source, const gfx::Point& pt);
47 50
48 // menus::SimpleMenuModel::Delegate implementation. 51 // menus::SimpleMenuModel::Delegate implementation.
49 virtual bool IsCommandIdChecked(int command_id) const; 52 virtual bool IsCommandIdChecked(int command_id) const;
50 virtual bool IsCommandIdEnabled(int command_id) const; 53 virtual bool IsCommandIdEnabled(int command_id) const;
51 virtual bool GetAcceleratorForCommandId(int command_id, 54 virtual bool GetAcceleratorForCommandId(int command_id,
52 menus::Accelerator* accelerator); 55 menus::Accelerator* accelerator);
53 virtual void ExecuteCommand(int command_id); 56 virtual void ExecuteCommand(int command_id);
54 57
55 // Switches the current locale, saves the new locale in preferences.
56 static void SwitchLanguage(const std::string& locale);
57
58 // Dialog controls that we own ourselves. 58 // Dialog controls that we own ourselves.
59 menus::SimpleMenuModel menu_model_; 59 menus::SimpleMenuModel menu_model_;
60 menus::SimpleMenuModel menu_model_submenu_; 60 menus::SimpleMenuModel menu_model_submenu_;
61 scoped_ptr<views::Menu2> menu_; 61 scoped_ptr<views::Menu2> menu_;
62 62
63 // Language locale name storage. 63 // Language locale name storage.
64 scoped_ptr<LanguageList> language_list_; 64 scoped_ptr<LanguageList> language_list_;
65 65
66 int delta_x_, delta_y_; 66 int delta_x_, delta_y_;
67 67
68 FRIEND_TEST(::WizardControllerTest, SwitchLanguage); 68 FRIEND_TEST(::WizardControllerTest, SwitchLanguage);
69 DISALLOW_COPY_AND_ASSIGN(LanguageSwitchModel); 69 DISALLOW_COPY_AND_ASSIGN(LanguageSwitchModel);
70 }; 70 };
71 71
72 } // namespace chromeos 72 } // namespace chromeos
73 73
74 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_ 74 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LANGUAGE_SWITCH_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/language_switch_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698