OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 namespace chromeos { | 47 namespace chromeos { |
48 | 48 |
49 OfflineLoadPage::OfflineLoadPage(TabContents* tab_contents, | 49 OfflineLoadPage::OfflineLoadPage(TabContents* tab_contents, |
50 const GURL& url, | 50 const GURL& url, |
51 OfflineResourceHandler* handler) | 51 OfflineResourceHandler* handler) |
52 : ChromeInterstitialPage(tab_contents, true, url), | 52 : ChromeInterstitialPage(tab_contents, true, url), |
53 handler_(handler), | 53 handler_(handler), |
54 proceeded_(false), | 54 proceeded_(false) { |
55 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { | |
56 net::NetworkChangeNotifier::AddOnlineStateObserver(this); | 55 net::NetworkChangeNotifier::AddOnlineStateObserver(this); |
57 } | 56 } |
58 | 57 |
59 OfflineLoadPage::~OfflineLoadPage() { | 58 OfflineLoadPage::~OfflineLoadPage() { |
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
61 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 60 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
62 } | 61 } |
63 | 62 |
64 std::string OfflineLoadPage::GetHTMLContents() { | 63 std::string OfflineLoadPage::GetHTMLContents() { |
65 DictionaryValue strings; | 64 DictionaryValue strings; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 for (size_t i = 0; i < cell_networks.size(); ++i) { | 204 for (size_t i = 0; i < cell_networks.size(); ++i) { |
206 chromeos::ActivationState activation_state = | 205 chromeos::ActivationState activation_state = |
207 cell_networks[i]->activation_state(); | 206 cell_networks[i]->activation_state(); |
208 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 207 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
209 return false; | 208 return false; |
210 } | 209 } |
211 return true; | 210 return true; |
212 } | 211 } |
213 | 212 |
214 } // namespace chromeos | 213 } // namespace chromeos |
OLD | NEW |