OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SIGNIN_SCREENLOCK_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_ |
6 #define CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_ | 6 #define CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void SetAnimation(size_t resource_width, size_t frame_length_ms); | 71 void SetAnimation(size_t resource_width, size_t frame_length_ms); |
72 | 72 |
73 // Sets the icon opacity. The values should be in <0, 100] interval, which | 73 // Sets the icon opacity. The values should be in <0, 100] interval, which |
74 // will get scaled into <0, 1] interval. The default value is 100. | 74 // will get scaled into <0, 1] interval. The default value is 100. |
75 void SetOpacity(size_t opacity); | 75 void SetOpacity(size_t opacity); |
76 | 76 |
77 // Sets the icon tooltip. If |autoshow| is set the tooltip is automatically | 77 // Sets the icon tooltip. If |autoshow| is set the tooltip is automatically |
78 // shown with the icon. | 78 // shown with the icon. |
79 void SetTooltip(const base::string16& tooltip, bool autoshow); | 79 void SetTooltip(const base::string16& tooltip, bool autoshow); |
80 | 80 |
| 81 // If hardlock on click is set, clicking the icon in the screenlock will |
| 82 // go to state where password is required for unlock. |
| 83 void SetHardlockOnClick(); |
| 84 |
81 private: | 85 private: |
82 std::string icon_resource_url_; | 86 std::string icon_resource_url_; |
83 scoped_ptr<gfx::Image> icon_image_; | 87 scoped_ptr<gfx::Image> icon_image_; |
84 | 88 |
85 size_t width_; | 89 size_t width_; |
86 size_t height_; | 90 size_t height_; |
87 | 91 |
88 bool animation_set_; | 92 bool animation_set_; |
89 size_t animation_resource_width_; | 93 size_t animation_resource_width_; |
90 size_t animation_frame_length_ms_; | 94 size_t animation_frame_length_ms_; |
91 | 95 |
92 // The opacity should be in <0, 100] range. | 96 // The opacity should be in <0, 100] range. |
93 size_t opacity_; | 97 size_t opacity_; |
94 | 98 |
95 base::string16 tooltip_; | 99 base::string16 tooltip_; |
96 bool autoshow_tooltip_; | 100 bool autoshow_tooltip_; |
97 | 101 |
| 102 bool hardlock_on_click_; |
| 103 |
98 DISALLOW_COPY_AND_ASSIGN(UserPodCustomIconOptions); | 104 DISALLOW_COPY_AND_ASSIGN(UserPodCustomIconOptions); |
99 }; | 105 }; |
100 | 106 |
101 class LockHandler { | 107 class LockHandler { |
102 public: | 108 public: |
103 // Supported authentication types. Keep in sync with the enum in | 109 // Supported authentication types. Keep in sync with the enum in |
104 // user_pod_row.js. | 110 // user_pod_row.js. |
105 enum AuthType { | 111 enum AuthType { |
106 OFFLINE_PASSWORD = 0, | 112 OFFLINE_PASSWORD = 0, |
107 ONLINE_SIGN_IN = 1, | 113 ONLINE_SIGN_IN = 1, |
108 NUMERIC_PIN = 2, | 114 NUMERIC_PIN = 2, |
109 USER_CLICK = 3, | 115 USER_CLICK = 3, |
110 EXPAND_THEN_USER_CLICK = 4, | 116 EXPAND_THEN_USER_CLICK = 4, |
| 117 FORCE_OFFLINE_PASSWORD = 5 |
111 }; | 118 }; |
112 | 119 |
113 // Displays |message| in a banner on the lock screen. | 120 // Displays |message| in a banner on the lock screen. |
114 virtual void ShowBannerMessage(const base::string16& message) = 0; | 121 virtual void ShowBannerMessage(const base::string16& message) = 0; |
115 | 122 |
116 // Shows a custom icon in the user pod on the lock screen. | 123 // Shows a custom icon in the user pod on the lock screen. |
117 virtual void ShowUserPodCustomIcon( | 124 virtual void ShowUserPodCustomIcon( |
118 const std::string& user_email, | 125 const std::string& user_email, |
119 const UserPodCustomIconOptions& icon) = 0; | 126 const UserPodCustomIconOptions& icon) = 0; |
120 | 127 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ScreenlockBridge(); | 167 ScreenlockBridge(); |
161 ~ScreenlockBridge(); | 168 ~ScreenlockBridge(); |
162 | 169 |
163 LockHandler* lock_handler_; // Not owned | 170 LockHandler* lock_handler_; // Not owned |
164 ObserverList<Observer, true> observers_; | 171 ObserverList<Observer, true> observers_; |
165 | 172 |
166 DISALLOW_COPY_AND_ASSIGN(ScreenlockBridge); | 173 DISALLOW_COPY_AND_ASSIGN(ScreenlockBridge); |
167 }; | 174 }; |
168 | 175 |
169 #endif // CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_ | 176 #endif // CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_ |
OLD | NEW |