OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/tether/tether_service.h" | 5 #include "chrome/browser/chromeos/tether/tether_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 TetherService::~TetherService() {} | 61 TetherService::~TetherService() {} |
62 | 62 |
63 void TetherService::StartTetherIfEnabled() { | 63 void TetherService::StartTetherIfEnabled() { |
64 if (GetTetherTechnologyState() != | 64 if (GetTetherTechnologyState() != |
65 chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED) { | 65 chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED) { |
66 return; | 66 return; |
67 } | 67 } |
68 | 68 |
69 auto notification_presenter = | 69 auto notification_presenter = |
70 base::MakeUnique<chromeos::tether::TetherNotificationPresenter>( | 70 base::MakeUnique<chromeos::tether::TetherNotificationPresenter>( |
71 message_center::MessageCenter::Get(), | 71 profile_, message_center::MessageCenter::Get(), |
72 chromeos::NetworkConnect::Get()); | 72 chromeos::NetworkConnect::Get()); |
73 chromeos::tether::Initializer::Init( | 73 chromeos::tether::Initializer::Init( |
74 cryptauth_service_, std::move(notification_presenter), | 74 cryptauth_service_, std::move(notification_presenter), |
75 profile_->GetPrefs(), | 75 profile_->GetPrefs(), |
76 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), | 76 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), |
77 network_state_handler_, | 77 network_state_handler_, |
78 chromeos::NetworkHandler::Get()->managed_network_configuration_handler(), | 78 chromeos::NetworkHandler::Get()->managed_network_configuration_handler(), |
79 chromeos::NetworkConnect::Get(), | 79 chromeos::NetworkConnect::Get(), |
80 chromeos::NetworkHandler::Get()->network_connection_handler()); | 80 chromeos::NetworkHandler::Get()->network_connection_handler()); |
81 } | 81 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // after enabling it. Possible solution: grey out the toggle and tell the | 205 // after enabling it. Possible solution: grey out the toggle and tell the |
206 // user to turn Bluetooth on? | 206 // user to turn Bluetooth on? |
207 return chromeos::NetworkStateHandler::TechnologyState:: | 207 return chromeos::NetworkStateHandler::TechnologyState:: |
208 TECHNOLOGY_UNINITIALIZED; | 208 TECHNOLOGY_UNINITIALIZED; |
209 } else if (!IsEnabledbyPreference()) { | 209 } else if (!IsEnabledbyPreference()) { |
210 return chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_AVAILABLE; | 210 return chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_AVAILABLE; |
211 } | 211 } |
212 | 212 |
213 return chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED; | 213 return chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED; |
214 } | 214 } |
OLD | NEW |