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

Side by Side Diff: chrome/browser/android/signin/signin_manager_android.cc

Issue 101653006: Remove GetDefaultProfile from various Android related code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Created 6 years, 11 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 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/android/signin/signin_manager_android.h" 5 #include "chrome/browser/android/signin/signin_manager_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 DISALLOW_COPY_AND_ASSIGN(ProfileDataRemover); 68 DISALLOW_COPY_AND_ASSIGN(ProfileDataRemover);
69 }; 69 };
70 70
71 } // namespace 71 } // namespace
72 72
73 SigninManagerAndroid::SigninManagerAndroid(JNIEnv* env, jobject obj) 73 SigninManagerAndroid::SigninManagerAndroid(JNIEnv* env, jobject obj)
74 : profile_(NULL), 74 : profile_(NULL),
75 weak_factory_(this) { 75 weak_factory_(this) {
76 java_signin_manager_.Reset(env, obj); 76 java_signin_manager_.Reset(env, obj);
77 DCHECK(g_browser_process); 77 profile_ = ProfileManager::GetActiveUserProfile();
78 DCHECK(g_browser_process->profile_manager());
79 profile_ = g_browser_process->profile_manager()->GetDefaultProfile();
80 DCHECK(profile_); 78 DCHECK(profile_);
81 } 79 }
82 80
83 SigninManagerAndroid::~SigninManagerAndroid() {} 81 SigninManagerAndroid::~SigninManagerAndroid() {}
84 82
85 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env, 83 void SigninManagerAndroid::CheckPolicyBeforeSignIn(JNIEnv* env,
86 jobject obj, 84 jobject obj,
87 jstring username) { 85 jstring username) {
88 #if defined(ENABLE_CONFIGURATION_POLICY) 86 #if defined(ENABLE_CONFIGURATION_POLICY)
89 username_ = base::android::ConvertJavaStringToUTF8(env, username); 87 username_ = base::android::ConvertJavaStringToUTF8(env, username);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); 244 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username);
247 #else 245 #else
248 return false; 246 return false;
249 #endif 247 #endif
250 } 248 }
251 249
252 // static 250 // static
253 bool SigninManagerAndroid::Register(JNIEnv* env) { 251 bool SigninManagerAndroid::Register(JNIEnv* env) {
254 return RegisterNativesImpl(env); 252 return RegisterNativesImpl(env);
255 } 253 }
OLDNEW
« no previous file with comments | « chrome/browser/android/dev_tools_server.cc ('k') | chrome/browser/autofill/android/personal_data_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698