| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Sets user preferences on virtual keyboard selection so that the virtual | 84 // Sets user preferences on virtual keyboard selection so that the virtual |
| 85 // keyboard extension specified by the |url| is always selected for the | 85 // keyboard extension specified by the |url| is always selected for the |
| 86 // |layout|. Returns false if a virtual keyboard extension whose address is | 86 // |layout|. Returns false if a virtual keyboard extension whose address is |
| 87 // |url| is not registered, or the extension specified by the |url| does not | 87 // |url| is not registered, or the extension specified by the |url| does not |
| 88 // support the |layout|. | 88 // support the |layout|. |
| 89 bool SetUserPreference(const std::string& layout, const GURL& url); | 89 bool SetUserPreference(const std::string& layout, const GURL& url); |
| 90 | 90 |
| 91 // Removes the preference for the |layout| added by SetUserPreference. | 91 // Removes the preference for the |layout| added by SetUserPreference. |
| 92 void RemoveUserPreference(const std::string& layout); | 92 void RemoveUserPreference(const std::string& layout); |
| 93 | 93 |
| 94 // Removes all preferences added by SetUserPreference. |
| 95 void ClearUserPreference(); |
| 96 |
| 94 protected: | 97 protected: |
| 95 // Selects and returns the most suitable virtual keyboard extension for the | 98 // Selects and returns the most suitable virtual keyboard extension for the |
| 96 // |layout|. Unlike SelectVirtualKeyboard(), this function only scans | 99 // |layout|. Unlike SelectVirtualKeyboard(), this function only scans |
| 97 // |keyboards_| and |system_keyboards_| (in this order), and never updates | 100 // |keyboards_| and |system_keyboards_| (in this order), and never updates |
| 98 // |current_|. The function is protected for testability. | 101 // |current_|. The function is protected for testability. |
| 99 const VirtualKeyboard* SelectVirtualKeyboardWithoutPreferences( | 102 const VirtualKeyboard* SelectVirtualKeyboardWithoutPreferences( |
| 100 const std::string& layout); | 103 const std::string& layout); |
| 101 | 104 |
| 102 private: | 105 private: |
| 103 // A list of third party virtual keyboard extensions. | 106 // A list of third party virtual keyboard extensions. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 114 // The virtual keyboard currently in use. | 117 // The virtual keyboard currently in use. |
| 115 const VirtualKeyboard* current_; | 118 const VirtualKeyboard* current_; |
| 116 | 119 |
| 117 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardSelector); | 120 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardSelector); |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace input_method | 123 } // namespace input_method |
| 121 } // namespace chromeos | 124 } // namespace chromeos |
| 122 | 125 |
| 123 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_VIRTUAL_KEYBOARD_SELECTOR_H_ |
| OLD | NEW |