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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 343743004: Implement a permission check for push. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased and addressed Michael's comments Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "chrome/browser/prerender/prerender_manager_factory.h" 59 #include "chrome/browser/prerender/prerender_manager_factory.h"
60 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" 60 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
61 #include "chrome/browser/profiles/chrome_version_service.h" 61 #include "chrome/browser/profiles/chrome_version_service.h"
62 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" 62 #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
63 #include "chrome/browser/profiles/profile_destroyer.h" 63 #include "chrome/browser/profiles/profile_destroyer.h"
64 #include "chrome/browser/profiles/profile_info_cache.h" 64 #include "chrome/browser/profiles/profile_info_cache.h"
65 #include "chrome/browser/profiles/profile_manager.h" 65 #include "chrome/browser/profiles/profile_manager.h"
66 #include "chrome/browser/profiles/profile_metrics.h" 66 #include "chrome/browser/profiles/profile_metrics.h"
67 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 67 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
68 #include "chrome/browser/search_engines/template_url_fetcher.h" 68 #include "chrome/browser/search_engines/template_url_fetcher.h"
69 #include "chrome/browser/services/gcm/gcm_permission_context.h"
70 #include "chrome/browser/services/gcm/gcm_permission_context_factory.h"
69 #include "chrome/browser/services/gcm/gcm_profile_service.h" 71 #include "chrome/browser/services/gcm/gcm_profile_service.h"
70 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" 72 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
71 #include "chrome/browser/services/gcm/push_messaging_service_impl.h" 73 #include "chrome/browser/services/gcm/push_messaging_service_impl.h"
72 #include "chrome/browser/sessions/session_service_factory.h" 74 #include "chrome/browser/sessions/session_service_factory.h"
73 #include "chrome/browser/ui/startup/startup_browser_creator.h" 75 #include "chrome/browser/ui/startup/startup_browser_creator.h"
74 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 76 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
75 #include "chrome/browser/webdata/web_data_service.h" 77 #include "chrome/browser/webdata/web_data_service.h"
76 #include "chrome/common/chrome_constants.h" 78 #include "chrome/common/chrome_constants.h"
77 #include "chrome/common/chrome_paths_internal.h" 79 #include "chrome/common/chrome_paths_internal.h"
78 #include "chrome/common/chrome_switches.h" 80 #include "chrome/common/chrome_switches.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 1025
1024 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { 1026 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() {
1025 return GetExtensionSpecialStoragePolicy(); 1027 return GetExtensionSpecialStoragePolicy();
1026 } 1028 }
1027 1029
1028 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { 1030 content::PushMessagingService* ProfileImpl::GetPushMessagingService() {
1029 return gcm::GCMProfileServiceFactory::GetForProfile( 1031 return gcm::GCMProfileServiceFactory::GetForProfile(
1030 this)->push_messaging_service(); 1032 this)->push_messaging_service();
1031 } 1033 }
1032 1034
1035 gcm::GCMPermissionContext* ProfileImpl::GetPushMessagingPermissionContext() {
1036 return gcm::GCMPermissionContextFactory::GetForProfile(this);
Elliot Glaysher 2014/06/19 18:07:14 Is there a reason you're adding more methods to th
Miguel Garcia 2014/06/19 21:49:22 Not really, mainly because that's what the midi an
1037 }
1038
1033 bool ProfileImpl::IsSameProfile(Profile* profile) { 1039 bool ProfileImpl::IsSameProfile(Profile* profile) {
1034 if (profile == static_cast<Profile*>(this)) 1040 if (profile == static_cast<Profile*>(this))
1035 return true; 1041 return true;
1036 Profile* otr_profile = off_the_record_profile_.get(); 1042 Profile* otr_profile = off_the_record_profile_.get();
1037 return otr_profile && profile == otr_profile; 1043 return otr_profile && profile == otr_profile;
1038 } 1044 }
1039 1045
1040 Time ProfileImpl::GetStartTime() const { 1046 Time ProfileImpl::GetStartTime() const {
1041 return start_time_; 1047 return start_time_;
1042 } 1048 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1314 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1309 #if defined(OS_CHROMEOS) 1315 #if defined(OS_CHROMEOS)
1310 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1316 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1311 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1317 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1312 g_browser_process->local_state()); 1318 g_browser_process->local_state());
1313 } 1319 }
1314 #endif // defined(OS_CHROMEOS) 1320 #endif // defined(OS_CHROMEOS)
1315 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1321 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1316 GetPrefs(), g_browser_process->local_state()); 1322 GetPrefs(), g_browser_process->local_state());
1317 } 1323 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698