OLD | NEW |
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/geolocation/chrome_access_token_store.h" | 5 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "components/prefs/pref_registry_simple.h" | 15 #include "components/prefs/pref_registry_simple.h" |
16 #include "components/prefs/pref_service.h" | 16 #include "components/prefs/pref_service.h" |
17 #include "components/prefs/scoped_user_pref_update.h" | 17 #include "components/prefs/scoped_user_pref_update.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 using content::AccessTokenStore; | 21 using device::AccessTokenStore; |
22 using content::BrowserThread; | 22 using content::BrowserThread; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 bool IsUnsupportedNetworkProviderUrl(const GURL& url) { | 26 bool IsUnsupportedNetworkProviderUrl(const GURL& url) { |
27 const std::string& spec = url.spec(); | 27 const std::string& spec = url.spec(); |
28 | 28 |
29 // Unsupported after Chrome v14. | 29 // Unsupported after Chrome v14. |
30 if (spec == "https://www.google.com/loc/json") | 30 if (spec == "https://www.google.com/loc/json") |
31 return true; | 31 return true; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 server_url.spec(), new base::StringValue(token)); | 122 server_url.spec(), new base::StringValue(token)); |
123 } | 123 } |
124 | 124 |
125 void ChromeAccessTokenStore::SaveAccessToken( | 125 void ChromeAccessTokenStore::SaveAccessToken( |
126 const GURL& server_url, | 126 const GURL& server_url, |
127 const base::string16& access_token) { | 127 const base::string16& access_token) { |
128 BrowserThread::PostTask( | 128 BrowserThread::PostTask( |
129 BrowserThread::UI, FROM_HERE, | 129 BrowserThread::UI, FROM_HERE, |
130 base::Bind(&SetAccessTokenOnUIThread, server_url, access_token)); | 130 base::Bind(&SetAccessTokenOnUIThread, server_url, access_token)); |
131 } | 131 } |
OLD | NEW |