Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/chromeos/login/web_page_screen.cc

Issue 10978016: Remove two functions on WebContentsDelegate which didn't belong in content. They were only called f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits and fixed prerender browser tests Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/login/web_page_screen.h" 5 #include "chrome/browser/chromeos/login/web_page_screen.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 8
9 using base::TimeDelta; 9 using base::TimeDelta;
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 namespace { 13 namespace {
14 14
15 // Time in seconds after page load is considered timed out. 15 // Time in seconds after page load is considered timed out.
16 const int kNetworkTimeoutSec = 10; 16 const int kNetworkTimeoutSec = 10;
17 17
18 } // namespace 18 } // namespace
19 19
20 WebPageScreen::WebPageScreen() {} 20 WebPageScreen::WebPageScreen() {}
21 21
22 WebPageScreen::~WebPageScreen() {} 22 WebPageScreen::~WebPageScreen() {}
23 23
24 /////////////////////////////////////////////////////////////////////////////// 24 ///////////////////////////////////////////////////////////////////////////////
25 // WebPageScreen, content::WebContentsDelegate implementation: 25 // WebPageScreen, content::WebContentsDelegate implementation:
26 26
27 bool WebPageScreen::ShouldAddNavigationToHistory(
28 const history::HistoryAddPageArgs& add_page_args,
29 content::NavigationType navigation_type) {
30 return false;
31 }
32
33 bool WebPageScreen::HandleContextMenu( 27 bool WebPageScreen::HandleContextMenu(
34 const content::ContextMenuParams& params) { 28 const content::ContextMenuParams& params) {
35 // Just return true because we don't want to show context menue. 29 // Just return true because we don't want to show context menue.
36 return true; 30 return true;
37 } 31 }
38 32
39 /////////////////////////////////////////////////////////////////////////////// 33 ///////////////////////////////////////////////////////////////////////////////
40 // WebPageScreen, protected: 34 // WebPageScreen, protected:
41 35
42 void WebPageScreen::OnNetworkTimeout() { 36 void WebPageScreen::OnNetworkTimeout() {
43 // TODO(nkostylev): Add better detection for limited connectivity. 37 // TODO(nkostylev): Add better detection for limited connectivity.
44 // http://crosbug.com/3690 38 // http://crosbug.com/3690
45 CloseScreen(ScreenObserver::CONNECTION_FAILED); 39 CloseScreen(ScreenObserver::CONNECTION_FAILED);
46 } 40 }
47 41
48 void WebPageScreen::StartTimeoutTimer() { 42 void WebPageScreen::StartTimeoutTimer() {
49 StopTimeoutTimer(); 43 StopTimeoutTimer();
50 timeout_timer_.Start(FROM_HERE, 44 timeout_timer_.Start(FROM_HERE,
51 TimeDelta::FromSeconds(kNetworkTimeoutSec), 45 TimeDelta::FromSeconds(kNetworkTimeoutSec),
52 this, 46 this,
53 &WebPageScreen::OnNetworkTimeout); 47 &WebPageScreen::OnNetworkTimeout);
54 } 48 }
55 49
56 void WebPageScreen::StopTimeoutTimer() { 50 void WebPageScreen::StopTimeoutTimer() {
57 if (timeout_timer_.IsRunning()) 51 if (timeout_timer_.IsRunning())
58 timeout_timer_.Stop(); 52 timeout_timer_.Stop();
59 } 53 }
60 54
61 } // namespace chromeos 55 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698