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

Side by Side Diff: chrome/browser/signin/signin_manager.cc

Issue 12817005: Allow encoded version of service=chromiumsync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Decode the URL instead of searching for two versions of the string Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 25 matching lines...) Expand all
36 #include "chrome/common/chrome_notification_types.h" 36 #include "chrome/common/chrome_notification_types.h"
37 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/pref_names.h" 38 #include "chrome/common/pref_names.h"
39 #include "content/public/browser/browser_thread.h" 39 #include "content/public/browser/browser_thread.h"
40 #include "content/public/browser/notification_service.h" 40 #include "content/public/browser/notification_service.h"
41 #include "content/public/browser/render_process_host.h" 41 #include "content/public/browser/render_process_host.h"
42 #include "google_apis/gaia/gaia_auth_fetcher.h" 42 #include "google_apis/gaia/gaia_auth_fetcher.h"
43 #include "google_apis/gaia/gaia_auth_util.h" 43 #include "google_apis/gaia/gaia_auth_util.h"
44 #include "google_apis/gaia/gaia_constants.h" 44 #include "google_apis/gaia/gaia_constants.h"
45 #include "google_apis/gaia/gaia_urls.h" 45 #include "google_apis/gaia/gaia_urls.h"
46 #include "net/base/escape.h"
46 #include "net/url_request/url_request_context.h" 47 #include "net/url_request/url_request_context.h"
47 #include "third_party/icu/public/i18n/unicode/regex.h" 48 #include "third_party/icu/public/i18n/unicode/regex.h"
48 49
49 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) 50 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
50 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" 51 #include "chrome/browser/policy/cloud/user_policy_signin_service.h"
51 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" 52 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h"
52 #endif 53 #endif
53 54
54 using namespace signin_internals_util; 55 using namespace signin_internals_util;
55 56
(...skipping 24 matching lines...) Expand all
80 url.host() == effective.host()) { 81 url.host() == effective.host()) {
81 return true; 82 return true;
82 } 83 }
83 84
84 GURL service_login(GaiaUrls::GetInstance()->service_login_url()); 85 GURL service_login(GaiaUrls::GetInstance()->service_login_url());
85 if (url.GetOrigin() != service_login.GetOrigin()) 86 if (url.GetOrigin() != service_login.GetOrigin())
86 return false; 87 return false;
87 88
88 // Any login UI URLs with signin=chromiumsync should be considered a web 89 // Any login UI URLs with signin=chromiumsync should be considered a web
89 // URL (relies on GAIA keeping the "service=chromiumsync" query string 90 // URL (relies on GAIA keeping the "service=chromiumsync" query string
90 // fragment intact even when embedding inside a "continue" parameter). 91 // fragment present even when embedding inside a "continue" parameter).
91 return url.query().find(kChromiumSyncService) != std::string::npos; 92 return net::UnescapeURLComponent(
93 url.query(), net::UnescapeRule::URL_SPECIAL_CHARS)
94 .find(kChromiumSyncService) != std::string::npos;
92 } 95 }
93 96
94 // static 97 // static
95 bool SigninManager::AreSigninCookiesAllowed(Profile* profile) { 98 bool SigninManager::AreSigninCookiesAllowed(Profile* profile) {
96 CookieSettings* cookie_settings = 99 CookieSettings* cookie_settings =
97 CookieSettings::Factory::GetForProfile(profile); 100 CookieSettings::Factory::GetForProfile(profile);
98 return AreSigninCookiesAllowed(cookie_settings); 101 return AreSigninCookiesAllowed(cookie_settings);
99 } 102 }
100 103
101 // static 104 // static
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 NotifySigninValueChanged(field, value)); 936 NotifySigninValueChanged(field, value));
934 } 937 }
935 938
936 void SigninManager::NotifyDiagnosticsObservers( 939 void SigninManager::NotifyDiagnosticsObservers(
937 const TimedSigninStatusField& field, 940 const TimedSigninStatusField& field,
938 const std::string& value) { 941 const std::string& value) {
939 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, 942 FOR_EACH_OBSERVER(SigninDiagnosticsObserver,
940 signin_diagnostics_observers_, 943 signin_diagnostics_observers_,
941 NotifySigninValueChanged(field, value)); 944 NotifySigninValueChanged(field, value));
942 } 945 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698