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