| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/browser/chromeos/network_state_notifier.h" | 11 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 12 #include "chrome/browser/tab_contents/interstitial_page.h" | 12 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 13 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
| 14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 15 | 15 |
| 16 class DictionaryValue; |
| 17 class Extension; |
| 16 class TabContents; | 18 class TabContents; |
| 17 | 19 |
| 18 namespace chromeos { | 20 namespace chromeos { |
| 19 | 21 |
| 20 // OfflineLoadPage class shows the interstitial page that is shown | 22 // OfflineLoadPage class shows the interstitial page that is shown |
| 21 // when no network is available and hides when some network (either | 23 // when no network is available and hides when some network (either |
| 22 // one of wifi, 3g or ethernet) becomes available. | 24 // one of wifi, 3g or ethernet) becomes available. |
| 23 // It deletes itself when the interstitial page is closed. | 25 // It deletes itself when the interstitial page is closed. |
| 24 class OfflineLoadPage : public InterstitialPage { | 26 class OfflineLoadPage : public InterstitialPage { |
| 25 public: | 27 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 virtual std::string GetHTMLContents(); | 54 virtual std::string GetHTMLContents(); |
| 53 virtual void CommandReceived(const std::string& command); | 55 virtual void CommandReceived(const std::string& command); |
| 54 virtual void Proceed(); | 56 virtual void Proceed(); |
| 55 virtual void DontProceed(); | 57 virtual void DontProceed(); |
| 56 | 58 |
| 57 // Overrides InterstitialPage's Observe. | 59 // Overrides InterstitialPage's Observe. |
| 58 virtual void Observe(NotificationType type, | 60 virtual void Observe(NotificationType type, |
| 59 const NotificationSource& source, | 61 const NotificationSource& source, |
| 60 const NotificationDetails& details); | 62 const NotificationDetails& details); |
| 61 | 63 |
| 64 // Retrieves template strings of the offline page for app and |
| 65 // normal site. |
| 66 void GetAppOfflineStrings(const Extension* app, |
| 67 const string16& faield_url, |
| 68 DictionaryValue* strings) const; |
| 69 void GetNormalOfflineStrings(const string16& faield_url, |
| 70 DictionaryValue* strings) const; |
| 71 |
| 62 Delegate* delegate_; | 72 Delegate* delegate_; |
| 63 NotificationRegistrar registrar_; | 73 NotificationRegistrar registrar_; |
| 64 | 74 |
| 65 DISALLOW_COPY_AND_ASSIGN(OfflineLoadPage); | 75 DISALLOW_COPY_AND_ASSIGN(OfflineLoadPage); |
| 66 }; | 76 }; |
| 67 | 77 |
| 68 } // namespace chromeos | 78 } // namespace chromeos |
| 69 | 79 |
| 70 #endif // CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ | 80 #endif // CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ |
| OLD | NEW |