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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.h

Issue 2785813002: arc: Provide UMA for OptIn flow. (Closed)
Patch Set: Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ARC_ARC_SESSION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <ostream> 9 #include <ostream>
10 #include <string> 10 #include <string>
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // MaybeReenableArc() directly. 295 // MaybeReenableArc() directly.
296 void MaybeStartArcDataRemoval(); 296 void MaybeStartArcDataRemoval();
297 void OnArcDataRemoved(bool success); 297 void OnArcDataRemoved(bool success);
298 298
299 // On ARC session stopped and/or data removal completion, this is called 299 // On ARC session stopped and/or data removal completion, this is called
300 // so that, if necessary, ARC session is restarted. 300 // so that, if necessary, ARC session is restarted.
301 // TODO(hidehiko): This can be removed after the racy state machine 301 // TODO(hidehiko): This can be removed after the racy state machine
302 // is fixed. 302 // is fixed.
303 void MaybeReenableArc(); 303 void MaybeReenableArc();
304 304
305 // Starts tracking of OptIn flow. Tracked flows are reported to UMA.
306 void StartOptInFlowTracking();
Luis Héctor Chávez 2017/03/30 15:49:25 Can we abstract this logic to stop giving too much
khmel 2017/03/30 17:01:43 That nice, thanks
307
308 // Stop tracking of OptIn flow. |succeeded| indicates that flow finished
309 // successfully.
310 void StopOptInFlowTracking(bool succeeded);
311
305 std::unique_ptr<ArcSessionRunner> arc_session_runner_; 312 std::unique_ptr<ArcSessionRunner> arc_session_runner_;
306 313
307 // Unowned pointer. Keeps current profile. 314 // Unowned pointer. Keeps current profile.
308 Profile* profile_ = nullptr; 315 Profile* profile_ = nullptr;
309 316
310 // Whether ArcSessionManager is requested to enable (starting to run ARC 317 // Whether ArcSessionManager is requested to enable (starting to run ARC
311 // instance) or not. 318 // instance) or not.
312 bool enable_requested_ = false; 319 bool enable_requested_ = false;
313 320
314 // Internal state machine. See also State enum class. 321 // Internal state machine. See also State enum class.
315 State state_ = State::NOT_INITIALIZED; 322 State state_ = State::NOT_INITIALIZED;
316 base::ObserverList<Observer> observer_list_; 323 base::ObserverList<Observer> observer_list_;
317 std::unique_ptr<ArcAppLauncher> playstore_launcher_; 324 std::unique_ptr<ArcAppLauncher> playstore_launcher_;
318 bool reenable_arc_ = false; 325 bool reenable_arc_ = false;
319 bool provisioning_reported_ = false; 326 bool provisioning_reported_ = false;
327 bool optin_flow_tracked_ = false;
328 bool optin_flow_error_detected_ = false;
320 base::OneShotTimer arc_sign_in_timer_; 329 base::OneShotTimer arc_sign_in_timer_;
321 330
322 std::unique_ptr<ArcSupportHost> support_host_; 331 std::unique_ptr<ArcSupportHost> support_host_;
323 332
324 std::unique_ptr<ArcTermsOfServiceNegotiator> terms_of_service_negotiator_; 333 std::unique_ptr<ArcTermsOfServiceNegotiator> terms_of_service_negotiator_;
325 334
326 std::unique_ptr<ArcAuthContext> context_; 335 std::unique_ptr<ArcAuthContext> context_;
327 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_; 336 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_;
328 337
329 // The time when the sign in process started. 338 // The time when the sign in process started.
330 base::Time sign_in_start_time_; 339 base::Time sign_in_start_time_;
331 // The time when ARC was about to start. 340 // The time when ARC was about to start.
332 base::Time arc_start_time_; 341 base::Time arc_start_time_;
333 base::Closure attempt_user_exit_callback_; 342 base::Closure attempt_user_exit_callback_;
334 343
335 // Must be the last member. 344 // Must be the last member.
336 base::WeakPtrFactory<ArcSessionManager> weak_ptr_factory_; 345 base::WeakPtrFactory<ArcSessionManager> weak_ptr_factory_;
337 346
338 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); 347 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager);
339 }; 348 };
340 349
341 // Outputs the stringified |state| to |os|. This is only for logging purposes. 350 // Outputs the stringified |state| to |os|. This is only for logging purposes.
342 std::ostream& operator<<(std::ostream& os, 351 std::ostream& operator<<(std::ostream& os,
343 const ArcSessionManager::State& state); 352 const ArcSessionManager::State& state);
344 353
345 } // namespace arc 354 } // namespace arc
346 355
347 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 356 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698