| OLD | NEW |
| 1 // Copyright (c) 2011 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/chromeos/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 namespace chromeos { | 48 namespace chromeos { |
| 49 | 49 |
| 50 OfflineLoadPage::OfflineLoadPage(WebContents* web_contents, | 50 OfflineLoadPage::OfflineLoadPage(WebContents* web_contents, |
| 51 const GURL& url, | 51 const GURL& url, |
| 52 OfflineResourceHandler* handler) | 52 OfflineResourceHandler* handler) |
| 53 : ChromeInterstitialPage(web_contents, true, url), | 53 : ChromeInterstitialPage(web_contents, true, url), |
| 54 handler_(handler), | 54 handler_(handler), |
| 55 proceeded_(false), | 55 proceeded_(false) { |
| 56 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { | |
| 57 net::NetworkChangeNotifier::AddOnlineStateObserver(this); | 56 net::NetworkChangeNotifier::AddOnlineStateObserver(this); |
| 58 } | 57 } |
| 59 | 58 |
| 60 OfflineLoadPage::~OfflineLoadPage() { | 59 OfflineLoadPage::~OfflineLoadPage() { |
| 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 62 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 61 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
| 63 } | 62 } |
| 64 | 63 |
| 65 std::string OfflineLoadPage::GetHTMLContents() { | 64 std::string OfflineLoadPage::GetHTMLContents() { |
| 66 DictionaryValue strings; | 65 DictionaryValue strings; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 for (size_t i = 0; i < cell_networks.size(); ++i) { | 205 for (size_t i = 0; i < cell_networks.size(); ++i) { |
| 207 chromeos::ActivationState activation_state = | 206 chromeos::ActivationState activation_state = |
| 208 cell_networks[i]->activation_state(); | 207 cell_networks[i]->activation_state(); |
| 209 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 208 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
| 210 return false; | 209 return false; |
| 211 } | 210 } |
| 212 return true; | 211 return true; |
| 213 } | 212 } |
| 214 | 213 |
| 215 } // namespace chromeos | 214 } // namespace chromeos |
| OLD | NEW |