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/chromeos/login/auth_prewarmer.h" | 5 #include "chrome/browser/chromeos/login/auth_prewarmer.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 8 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
9 #include "chrome/browser/net/chrome_url_request_context.h" | 9 #include "chrome/browser/net/chrome_url_request_context.h" |
10 #include "chrome/browser/net/preconnect.h" | 10 #include "chrome/browser/net/preconnect.h" |
11 #include "chromeos/network/network_handler.h" | 11 #include "chromeos/network/network_handler.h" |
12 #include "chromeos/network/network_state.h" | 12 #include "chromeos/network/network_state.h" |
13 #include "chromeos/network/network_state_handler.h" | 13 #include "chromeos/network/network_state_handler.h" |
| 14 #include "chromeos/network/shill_property_util.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "google_apis/gaia/gaia_urls.h" | 16 #include "google_apis/gaia/gaia_urls.h" |
16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 AuthPrewarmer::AuthPrewarmer() | 21 AuthPrewarmer::AuthPrewarmer() |
21 : doing_prewarm_(false) { | 22 : doing_prewarm_(false) { |
22 } | 23 } |
23 | 24 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 106 } |
106 if (!completion_callback_.is_null()) { | 107 if (!completion_callback_.is_null()) { |
107 content::BrowserThread::PostTask(content::BrowserThread::UI, | 108 content::BrowserThread::PostTask(content::BrowserThread::UI, |
108 FROM_HERE, | 109 FROM_HERE, |
109 completion_callback_); | 110 completion_callback_); |
110 } | 111 } |
111 } | 112 } |
112 | 113 |
113 bool AuthPrewarmer::IsNetworkConnected() const { | 114 bool AuthPrewarmer::IsNetworkConnected() const { |
114 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); | 115 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); |
115 return (nsh->ConnectedNetworkByType(NetworkStateHandler::kMatchTypeDefault) != | 116 return (nsh->ConnectedNetworkByType(NetworkTypePattern::Default()) != NULL); |
116 NULL); | |
117 } | 117 } |
118 | 118 |
119 net::URLRequestContextGetter* AuthPrewarmer::GetRequestContext() const { | 119 net::URLRequestContextGetter* AuthPrewarmer::GetRequestContext() const { |
120 return ProfileHelper::GetSigninProfile()->GetRequestContext(); | 120 return ProfileHelper::GetSigninProfile()->GetRequestContext(); |
121 } | 121 } |
122 | 122 |
123 } // namespace chromeos | 123 } // namespace chromeos |
124 | 124 |
OLD | NEW |