Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains helper functions used by Chromium OS login. | 5 // This file contains helper functions used by Chromium OS login. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
| 8 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 8 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 // |size| is not empty. Otherwise the whole monitor is occupied. | 35 // |size| is not empty. Otherwise the whole monitor is occupied. |
| 36 gfx::Rect CalculateScreenBounds(const gfx::Size& size); | 36 gfx::Rect CalculateScreenBounds(const gfx::Size& size); |
| 37 | 37 |
| 38 // Returns the size of user image required for proper display under current DPI. | 38 // Returns the size of user image required for proper display under current DPI. |
| 39 int GetCurrentUserImageSize(); | 39 int GetCurrentUserImageSize(); |
| 40 | 40 |
| 41 // Define the constants in |login| namespace to avoid potential | 41 // Define the constants in |login| namespace to avoid potential |
| 42 // conflict with other chromeos components. | 42 // conflict with other chromeos components. |
| 43 namespace login { | 43 namespace login { |
| 44 | 44 |
| 45 // Possible error states of the Active Directory screen. Must be in the same | |
| 46 // order as ACTIVE_DIRECTORY_ERROR_STATE enum values. | |
| 47 enum ActiveDirectoryErrorState { | |
|
achuithb
2017/03/07 15:07:03
Can you make this an enum class since you're touch
Roman Sorokin (ftl)
2017/03/07 15:18:20
I'm not sure, it's needed in both enrollment_scree
achuithb
2017/03/07 15:28:50
How about moving it to enrollment_screen_handler.h
Roman Sorokin (ftl)
2017/03/07 16:32:05
That way gaia_screen_handler.cc does not see it
achuithb
2017/03/09 10:34:06
Why not include enrollment_screen_handler.h in gai
Roman Sorokin (ftl)
2017/03/22 15:19:25
Done.
| |
| 48 ERROR_STATE_NONE = 0, | |
| 49 ERROR_STATE_MACHINE_NAME_INVALID = 1, | |
| 50 ERROR_STATE_MACHINE_NAME_TOO_LONG = 2, | |
| 51 ERROR_STATE_BAD_USERNAME = 3, | |
| 52 ERROR_STATE_BAD_PASSWORD = 4, | |
| 53 }; | |
| 54 | |
| 45 // Maximum size of user image, in which it should be saved to be properly | 55 // Maximum size of user image, in which it should be saved to be properly |
| 46 // displayed under all possible DPI values. | 56 // displayed under all possible DPI values. |
| 47 const int kMaxUserImageSize = 512; | 57 const int kMaxUserImageSize = 512; |
| 48 | 58 |
| 49 // Returns true if lock/login should scroll user pods into view itself when | 59 // Returns true if lock/login should scroll user pods into view itself when |
| 50 // virtual keyboard is shown and disable vk overscroll. | 60 // virtual keyboard is shown and disable vk overscroll. |
| 51 bool LoginScrollIntoViewEnabled(); | 61 bool LoginScrollIntoViewEnabled(); |
| 52 | 62 |
| 53 // A helper class for easily mocking out Network*Handler calls for tests. | 63 // A helper class for easily mocking out Network*Handler calls for tests. |
| 54 class NetworkStateHelper { | 64 class NetworkStateHelper { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 // Returns file descriptor of a pipe, open for reading. Pipe keeps the passed | 122 // Returns file descriptor of a pipe, open for reading. Pipe keeps the passed |
| 113 // data. | 123 // data. |
| 114 void GetPipeReadEnd(const std::string& data, | 124 void GetPipeReadEnd(const std::string& data, |
| 115 const OnPipeReadyCallback& callback); | 125 const OnPipeReadyCallback& callback); |
| 116 | 126 |
| 117 } // namespace login | 127 } // namespace login |
| 118 | 128 |
| 119 } // namespace chromeos | 129 } // namespace chromeos |
| 120 | 130 |
| 121 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 131 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
| OLD | NEW |