| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 9 #include "base/timer.h" | 11 #include "base/timer.h" |
| 10 #include "chrome/browser/chromeos/login/screen_observer.h" | 12 #include "chrome/browser/chromeos/login/screen_observer.h" |
| 11 #include "content/browser/tab_contents/tab_contents_delegate.h" | 13 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 12 | 14 |
| 13 class GURL; | 15 class GURL; |
| 14 | 16 |
| 15 namespace chromeos { | 17 namespace chromeos { |
| 16 | 18 |
| 17 // Base class for wizard screen that holds web page. | 19 // Base class for wizard screen that holds web page. |
| 18 class WebPageScreen : public TabContentsDelegate { | 20 class WebPageScreen : public TabContentsDelegate { |
| 19 public: | 21 public: |
| 20 explicit WebPageScreen(); | 22 explicit WebPageScreen(); |
| 21 virtual ~WebPageScreen(); | 23 virtual ~WebPageScreen(); |
| 22 | 24 |
| 23 // Exits from the screen with the specified exit code. | 25 // Exits from the screen with the specified exit code. |
| 24 virtual void CloseScreen(ScreenObserver::ExitCodes code) = 0; | 26 virtual void CloseScreen(ScreenObserver::ExitCodes code) = 0; |
| 25 | 27 |
| 26 protected: | 28 protected: |
| 27 // TabContentsDelegate implementation: | 29 // TabContentsDelegate implementation: |
| 28 virtual bool IsPopup(TabContents* source); | |
| 29 virtual bool ShouldAddNavigationToHistory( | 30 virtual bool ShouldAddNavigationToHistory( |
| 30 const history::HistoryAddPageArgs& add_page_args, | 31 const history::HistoryAddPageArgs& add_page_args, |
| 31 content::NavigationType navigation_type); | 32 content::NavigationType navigation_type) OVERRIDE; |
| 32 virtual bool HandleContextMenu(const ContextMenuParams& params); | 33 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; |
| 33 | 34 |
| 34 // Called by |timeout_timer_|. Stops page fetching and closes screen. | 35 // Called by |timeout_timer_|. Stops page fetching and closes screen. |
| 35 virtual void OnNetworkTimeout(); | 36 virtual void OnNetworkTimeout(); |
| 36 | 37 |
| 37 // Start/stop timeout timer. | 38 // Start/stop timeout timer. |
| 38 void StartTimeoutTimer(); | 39 void StartTimeoutTimer(); |
| 39 void StopTimeoutTimer(); | 40 void StopTimeoutTimer(); |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 // Timer used for network response timeout. | 43 // Timer used for network response timeout. |
| 43 base::OneShotTimer<WebPageScreen> timeout_timer_; | 44 base::OneShotTimer<WebPageScreen> timeout_timer_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(WebPageScreen); | 46 DISALLOW_COPY_AND_ASSIGN(WebPageScreen); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace chromeos | 49 } // namespace chromeos |
| 49 | 50 |
| 50 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ | 51 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WEB_PAGE_SCREEN_H_ |
| OLD | NEW |