blob: f7519a16a4aa91a62609a1532946b7426e4861ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}
}
} // namespace chromeos
|