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

Side by Side Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.h

Issue 931993002: Make image_decoder a Leaky LazyInstance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Get rid of IDMap Created 5 years, 9 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
OLDNEW
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_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCREEN _H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCREEN _H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCREEN _H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCREEN _H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 class ErrorScreensHistogramHelper; 25 class ErrorScreensHistogramHelper;
26 class NetworkState; 26 class NetworkState;
27 class ScreenManager; 27 class ScreenManager;
28 28
29 // Class that controls screen showing ui for supervised user creation. 29 // Class that controls screen showing ui for supervised user creation.
30 class SupervisedUserCreationScreen 30 class SupervisedUserCreationScreen
31 : public BaseScreen, 31 : public BaseScreen,
32 public SupervisedUserCreationScreenHandler::Delegate, 32 public SupervisedUserCreationScreenHandler::Delegate,
33 public SupervisedUserCreationController::StatusConsumer, 33 public SupervisedUserCreationController::StatusConsumer,
34 public SupervisedUserSyncServiceObserver, 34 public SupervisedUserSyncServiceObserver,
35 public ImageDecoder::Delegate, 35 public ImageDecoder::ImageRequest,
36 public NetworkPortalDetector::Observer, 36 public NetworkPortalDetector::Observer,
37 public CameraPresenceNotifier::Observer { 37 public CameraPresenceNotifier::Observer {
38 public: 38 public:
39 SupervisedUserCreationScreen(BaseScreenDelegate* base_screen_delegate, 39 SupervisedUserCreationScreen(BaseScreenDelegate* base_screen_delegate,
40 SupervisedUserCreationScreenHandler* actor); 40 SupervisedUserCreationScreenHandler* actor);
41 ~SupervisedUserCreationScreen() override; 41 ~SupervisedUserCreationScreen() override;
42 42
43 static SupervisedUserCreationScreen* Get(ScreenManager* manager); 43 static SupervisedUserCreationScreen* Get(ScreenManager* manager);
44 44
45 // Makes screen to show message about inconsistency in manager login flow 45 // Makes screen to show message about inconsistency in manager login flow
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const NetworkPortalDetector::CaptivePortalState& state) override; 109 const NetworkPortalDetector::CaptivePortalState& state) override;
110 110
111 // TODO(antrim) : this is an explicit code duplications with UserImageScreen. 111 // TODO(antrim) : this is an explicit code duplications with UserImageScreen.
112 // It should be removed by issue 251179. 112 // It should be removed by issue 251179.
113 113
114 // SupervisedUserCreationScreenHandler::Delegate (image) implementation: 114 // SupervisedUserCreationScreenHandler::Delegate (image) implementation:
115 void OnPhotoTaken(const std::string& raw_data) override; 115 void OnPhotoTaken(const std::string& raw_data) override;
116 void OnImageSelected(const std::string& image_url, 116 void OnImageSelected(const std::string& image_url,
117 const std::string& image_type) override; 117 const std::string& image_type) override;
118 void OnImageAccepted() override; 118 void OnImageAccepted() override;
119 // ImageDecoder::Delegate overrides: 119 // ImageDecoder::ImageRequest overrides:
120 void OnImageDecoded(const ImageDecoder* decoder, 120 void OnImageDecoded(const SkBitmap& decoded_image) override;
121 const SkBitmap& decoded_image) override; 121 void OnDecodeImageFailed() override;
122 void OnDecodeImageFailed(const ImageDecoder* decoder) override;
123 122
124 private: 123 private:
125 void ApplyPicture(); 124 void ApplyPicture();
126 void OnGetSupervisedUsers(const base::DictionaryValue* users); 125 void OnGetSupervisedUsers(const base::DictionaryValue* users);
127 126
128 SupervisedUserCreationScreenHandler* actor_; 127 SupervisedUserCreationScreenHandler* actor_;
129 128
130 scoped_ptr<SupervisedUserCreationController> controller_; 129 scoped_ptr<SupervisedUserCreationController> controller_;
131 scoped_ptr<base::DictionaryValue> existing_users_; 130 scoped_ptr<base::DictionaryValue> existing_users_;
132 131
133 bool on_error_screen_; 132 bool on_error_screen_;
134 bool manager_signin_in_progress_; 133 bool manager_signin_in_progress_;
135 std::string last_page_; 134 std::string last_page_;
136 135
137 SupervisedUserSyncService* sync_service_; 136 SupervisedUserSyncService* sync_service_;
138 137
139 gfx::ImageSkia user_photo_; 138 gfx::ImageSkia user_photo_;
140 scoped_refptr<ImageDecoder> image_decoder_;
141 bool apply_photo_after_decoding_; 139 bool apply_photo_after_decoding_;
142 int selected_image_; 140 int selected_image_;
143 141
144 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_; 142 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_;
145 143
146 base::WeakPtrFactory<SupervisedUserCreationScreen> weak_factory_; 144 base::WeakPtrFactory<SupervisedUserCreationScreen> weak_factory_;
147 145
148 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationScreen); 146 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationScreen);
149 }; 147 };
150 148
151 } // namespace chromeos 149 } // namespace chromeos
152 150
153 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCR EEN_H_ 151 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_CREATION_SCR EEN_H_
154 152
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698