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

Unified Diff: chromeos/components/tether/tether_device_state_manager.cc

Issue 2819993002: [CrOS Tether] Add the notion of a tether DeviceState. (Closed)
Patch Set: hansberry@ comments. Created 3 years, 8 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: chromeos/components/tether/tether_device_state_manager.cc
diff --git a/chromeos/components/tether/tether_device_state_manager.cc b/chromeos/components/tether/tether_device_state_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a8c561ebbf0d29190e88e59d6cad7a2371a01914
--- /dev/null
+++ b/chromeos/components/tether/tether_device_state_manager.cc
@@ -0,0 +1,38 @@
+// Copyright 2017 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 "chromeos/components/tether/tether_device_state_manager.h"
+
+#include "chromeos/network/network_state_handler.h"
+
+namespace chromeos {
+
+namespace tether {
+
+TetherDeviceStateManager::TetherDeviceStateManager(
+ NetworkStateHandler* network_state_handler)
+ : network_state_handler_(network_state_handler) {
+ network_state_handler_->AddObserver(this, FROM_HERE);
+
+ // TODO(hansberry): Set the appropriate value. For now, always set ENABLED.
+ network_state_handler_->SetTetherTechnologyState(
+ NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED);
+}
+
+TetherDeviceStateManager::~TetherDeviceStateManager() {
+ network_state_handler_->RemoveObserver(this, FROM_HERE);
+
+ // TODO(hansberry): Determine if this should be PROHIBITED or UNAVAILABLE
+ // based on reason for shutting down.
+ network_state_handler_->SetTetherTechnologyState(
+ NetworkStateHandler::TechnologyState::TECHNOLOGY_UNAVAILABLE);
+}
+
+void TetherDeviceStateManager::DeviceListChanged() {
+ // TODO(hansberry): Implement.
+}
+
+} // namespace tether
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698