| 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/chromeos/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
| 44 #include "ui/base/webui/jstemplate_builder.h" | 44 #include "ui/base/webui/jstemplate_builder.h" |
| 45 #include "ui/base/webui/web_ui_util.h" | 45 #include "ui/base/webui/web_ui_util.h" |
| 46 | 46 |
| 47 using content::BrowserThread; | 47 using content::BrowserThread; |
| 48 using content::InterstitialPage; | 48 using content::InterstitialPage; |
| 49 using content::WebContents; | 49 using content::WebContents; |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 | 52 |
| 53 // Maximum time to show a blank page. | |
| 54 const int kMaxBlankPeriod = 3000; | |
| 55 | |
| 56 // A utility function to set the dictionary's value given by |resource_id|. | 53 // A utility function to set the dictionary's value given by |resource_id|. |
| 57 void SetString(DictionaryValue* strings, const char* name, int resource_id) { | 54 void SetString(DictionaryValue* strings, const char* name, int resource_id) { |
| 58 strings->SetString(name, l10n_util::GetStringUTF16(resource_id)); | 55 strings->SetString(name, l10n_util::GetStringUTF16(resource_id)); |
| 59 } | 56 } |
| 60 | 57 |
| 61 } // namespace | 58 } // namespace |
| 62 | 59 |
| 63 namespace chromeos { | 60 namespace chromeos { |
| 64 | 61 |
| 65 OfflineLoadPage::OfflineLoadPage(WebContents* web_contents, | 62 OfflineLoadPage::OfflineLoadPage(WebContents* web_contents, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 162 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
| 166 DVLOG(1) << "ConnectionTypeObserver notification received: state=" | 163 DVLOG(1) << "ConnectionTypeObserver notification received: state=" |
| 167 << (online ? "online" : "offline"); | 164 << (online ? "online" : "offline"); |
| 168 if (online) { | 165 if (online) { |
| 169 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 166 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
| 170 interstitial_page_->Proceed(); | 167 interstitial_page_->Proceed(); |
| 171 } | 168 } |
| 172 } | 169 } |
| 173 | 170 |
| 174 } // namespace chromeos | 171 } // namespace chromeos |
| OLD | NEW |