OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/managed_mode/managed_user_service.h" | 5 #include "chrome/browser/managed_mode/managed_user_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
31 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 31 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
32 #include "chrome/browser/signin/signin_manager_factory.h" | 32 #include "chrome/browser/signin/signin_manager_factory.h" |
33 #include "chrome/browser/sync/profile_sync_service.h" | 33 #include "chrome/browser/sync/profile_sync_service.h" |
34 #include "chrome/browser/sync/profile_sync_service_factory.h" | 34 #include "chrome/browser/sync/profile_sync_service_factory.h" |
35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
36 #include "chrome/browser/ui/browser_list.h" | 36 #include "chrome/browser/ui/browser_list.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/extensions/api/managed_mode_private/managed_mode_handler
.h" | 38 #include "chrome/common/extensions/api/managed_mode_private/managed_mode_handler
.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 40 #include "components/pref_registry/pref_registry_syncable.h" |
40 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 41 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
41 #include "components/signin/core/browser/signin_manager.h" | 42 #include "components/signin/core/browser/signin_manager.h" |
42 #include "components/signin/core/browser/signin_manager_base.h" | 43 #include "components/signin/core/browser/signin_manager_base.h" |
43 #include "components/user_prefs/pref_registry_syncable.h" | |
44 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
45 #include "content/public/browser/notification_details.h" | 45 #include "content/public/browser/notification_details.h" |
46 #include "content/public/browser/notification_source.h" | 46 #include "content/public/browser/notification_source.h" |
47 #include "content/public/browser/user_metrics.h" | 47 #include "content/public/browser/user_metrics.h" |
48 #include "extensions/browser/extension_system.h" | 48 #include "extensions/browser/extension_system.h" |
49 #include "extensions/common/extension_set.h" | 49 #include "extensions/common/extension_set.h" |
50 #include "google_apis/gaia/google_service_auth_error.h" | 50 #include "google_apis/gaia/google_service_auth_error.h" |
51 #include "grit/generated_resources.h" | 51 #include "grit/generated_resources.h" |
52 #include "net/base/escape.h" | 52 #include "net/base/escape.h" |
53 #include "ui/base/l10n/l10n_util.h" | 53 #include "ui/base/l10n/l10n_util.h" |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 void ManagedUserService::OnBrowserSetLastActive(Browser* browser) { | 697 void ManagedUserService::OnBrowserSetLastActive(Browser* browser) { |
698 bool profile_became_active = profile_->IsSameProfile(browser->profile()); | 698 bool profile_became_active = profile_->IsSameProfile(browser->profile()); |
699 if (!is_profile_active_ && profile_became_active) | 699 if (!is_profile_active_ && profile_became_active) |
700 content::RecordAction(UserMetricsAction("ManagedUsers_OpenProfile")); | 700 content::RecordAction(UserMetricsAction("ManagedUsers_OpenProfile")); |
701 else if (is_profile_active_ && !profile_became_active) | 701 else if (is_profile_active_ && !profile_became_active) |
702 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 702 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
703 | 703 |
704 is_profile_active_ = profile_became_active; | 704 is_profile_active_ = profile_became_active; |
705 } | 705 } |
OLD | NEW |