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

Unified Diff: components/offline_pages/background/device_conditions.h

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: rebase Created 4 years 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: components/offline_pages/background/device_conditions.h
diff --git a/components/offline_pages/background/device_conditions.h b/components/offline_pages/background/device_conditions.h
deleted file mode 100644
index b96306a4d4b949cddb7cfba34f325b7ac76c45ae..0000000000000000000000000000000000000000
--- a/components/offline_pages/background/device_conditions.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_DEVICE_CONDITIONS_H_
-#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_DEVICE_CONDITIONS_H_
-
-#include "net/base/network_change_notifier.h"
-
-namespace offline_pages {
-
-// Device network and power conditions.
-class DeviceConditions {
- public:
- DeviceConditions(
- bool power_connected,
- int battery_percentage,
- net::NetworkChangeNotifier::ConnectionType net_connection_type)
- : power_connected_(power_connected),
- battery_percentage_(battery_percentage),
- net_connection_type_(net_connection_type) {}
-
- DeviceConditions()
- : power_connected_(true), battery_percentage_(75),
- net_connection_type_(net::NetworkChangeNotifier::CONNECTION_WIFI) {}
-
- // Returns whether power is connected.
- bool IsPowerConnected() const { return power_connected_; }
-
- // Returns percentage of remaining battery power (0-100).
- int GetBatteryPercentage() const { return battery_percentage_; }
-
- // Returns the current type of network connection, if any.
- net::NetworkChangeNotifier::ConnectionType GetNetConnectionType() const {
- return net_connection_type_;
- }
-
- private:
- const bool power_connected_;
- const int battery_percentage_;
- const net::NetworkChangeNotifier::ConnectionType net_connection_type_;
-
- // NOTE: We intentionally allow the default copy constructor and assignment.
-};
-
-} // namespace offline_pages
-
-#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_DEVICE_CONDITIONS_H_
« no previous file with comments | « components/offline_pages/background/connection_notifier.cc ('k') | components/offline_pages/background/get_requests_task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698