| OLD | NEW | 
|   1 // Copyright 2013 The Chromium Authors. All rights reserved. |   1 // Copyright 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/media/protected_media_identifier_permission_context_fac
    tory.h" |   5 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
    tory.h" | 
|   6  |   6  | 
|   7 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |   7 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 
|   8 #include "chrome/browser/profiles/incognito_helpers.h" |   8 #include "chrome/browser/profiles/incognito_helpers.h" | 
|   9 #include "chrome/browser/profiles/profile.h" |   9 #include "chrome/browser/profiles/profile.h" | 
|  10 #include "chrome/common/pref_names.h" |  10 #include "chrome/common/pref_names.h" | 
|  11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |  11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 
|  12 #include "components/pref_registry/pref_registry_syncable.h" |  12 #include "components/pref_registry/pref_registry_syncable.h" | 
|  13  |  13  | 
|  14 // static |  14 // static | 
|  15 ProtectedMediaIdentifierPermissionContext* |  15 ProtectedMediaIdentifierPermissionContext* | 
|  16 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile( |  16 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile( | 
|  17     Profile* profile) { |  17     Profile* profile) { | 
|  18   return static_cast<ProtectedMediaIdentifierPermissionContext*>( |  18   return static_cast<ProtectedMediaIdentifierPermissionContext*>( | 
|  19       GetInstance()->GetServiceForBrowserContext(profile, true)); |  19       GetInstance()->GetServiceForBrowserContext(profile, true)); | 
|  20 } |  20 } | 
|  21  |  21  | 
|  22 // static |  22 // static | 
|  23 ProtectedMediaIdentifierPermissionContextFactory* |  23 ProtectedMediaIdentifierPermissionContextFactory* | 
|  24 ProtectedMediaIdentifierPermissionContextFactory::GetInstance() { |  24 ProtectedMediaIdentifierPermissionContextFactory::GetInstance() { | 
|  25   return Singleton< |  25   return base::Singleton< | 
|  26       ProtectedMediaIdentifierPermissionContextFactory>::get(); |  26       ProtectedMediaIdentifierPermissionContextFactory>::get(); | 
|  27 } |  27 } | 
|  28  |  28  | 
|  29 ProtectedMediaIdentifierPermissionContextFactory:: |  29 ProtectedMediaIdentifierPermissionContextFactory:: | 
|  30 ProtectedMediaIdentifierPermissionContextFactory() |  30 ProtectedMediaIdentifierPermissionContextFactory() | 
|  31     : BrowserContextKeyedServiceFactory( |  31     : BrowserContextKeyedServiceFactory( | 
|  32           "ProtectedMediaIdentifierPermissionContext", |  32           "ProtectedMediaIdentifierPermissionContext", | 
|  33           BrowserContextDependencyManager::GetInstance()) { |  33           BrowserContextDependencyManager::GetInstance()) { | 
|  34 } |  34 } | 
|  35  |  35  | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
|  50 #if defined(OS_ANDROID) |  50 #if defined(OS_ANDROID) | 
|  51   registry->RegisterBooleanPref(prefs::kProtectedMediaIdentifierEnabled, true); |  51   registry->RegisterBooleanPref(prefs::kProtectedMediaIdentifierEnabled, true); | 
|  52 #endif |  52 #endif | 
|  53 } |  53 } | 
|  54  |  54  | 
|  55 content::BrowserContext* |  55 content::BrowserContext* | 
|  56 ProtectedMediaIdentifierPermissionContextFactory::GetBrowserContextToUse( |  56 ProtectedMediaIdentifierPermissionContextFactory::GetBrowserContextToUse( | 
|  57     content::BrowserContext* context) const { |  57     content::BrowserContext* context) const { | 
|  58   return chrome::GetBrowserContextOwnInstanceInIncognito(context); |  58   return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 
|  59 } |  59 } | 
| OLD | NEW |