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

Unified Diff: chrome/browser/chromeos/prerender_condition_network.cc

Issue 7517016: Add prerender to ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add prerender_condition.h and OVERRIDE Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/prerender_condition_network.cc
diff --git a/chrome/browser/chromeos/prerender_condition_network.cc b/chrome/browser/chromeos/prerender_condition_network.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f7519a16a4aa91a62609a1532946b7426e4861ad
--- /dev/null
+++ b/chrome/browser/chromeos/prerender_condition_network.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/prerender_condition_network.h"
+
+namespace chromeos {
+
+PrerenderConditionNetwork::PrerenderConditionNetwork(
+ NetworkLibrary* network_library) : network_library_(network_library) {
+ DCHECK(network_library_);
+}
+
+PrerenderConditionNetwork::~PrerenderConditionNetwork() {
+}
+
+bool PrerenderConditionNetwork::CanPrerender() const {
+ const Network* active_network = network_library_->active_network();
+ if (!active_network)
+ return false;
+ switch (active_network->type()) {
+ case TYPE_ETHERNET:
+ case TYPE_WIFI:
+ return true;
+ default:
+ return false;
+ }
+}
Eric Shienbrood 2011/07/27 22:06:33 I think you're right to keep things simple for now
cbentzel 2011/07/28 13:00:32 The concern is more about usage caps at this point
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/prerender_condition_network.h ('k') | chrome/browser/prerender/prerender_condition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698