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

Side by Side Diff: chrome/browser/sync/test/integration/wifi_credentials_helper_chromeos.cc

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: fix android_aosp build Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/test/integration/wifi_credentials_helper_chromeos. h"
6
7 #include <string>
8
9 #include "base/files/file_path.h"
10 #include "base/logging.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "chromeos/network/network_handler.h"
13 #include "chromeos/network/network_state.h"
14 #include "chromeos/network/network_state_handler.h"
15 #include "components/wifi_sync/network_state_helper_chromeos.h"
16 #include "components/wifi_sync/wifi_security_class.h"
17
18 using WifiCredentialSet = wifi_sync::WifiCredential::CredentialSet;
19
20 namespace wifi_credentials_helper {
21
22 namespace {
23
24 const char kProfilePrefix[] = "/profile/";
25
26 std::string ChromeOsUserHashForBrowserContext(
27 const content::BrowserContext& context) {
28 return context.GetPath().BaseName().value();
29 }
30
31 std::string ShillProfilePathForBrowserContext(
32 const content::BrowserContext& context) {
33 return kProfilePrefix + ChromeOsUserHashForBrowserContext(context);
34 }
35
36 chromeos::NetworkStateHandler* GetNetworkStateHandler() {
37 DCHECK(chromeos::NetworkHandler::Get()->network_state_handler());
38 return chromeos::NetworkHandler::Get()->network_state_handler();
39 }
40
41 } // namespace
42
43 WifiCredentialSet GetWifiCredentialsForProfileChromeOs(const Profile* profile) {
44 DCHECK(profile);
45 return wifi_sync::GetWifiCredentialsForShillProfile(
46 GetNetworkStateHandler(), ShillProfilePathForBrowserContext(*profile));
47 }
48
49 } // namespace wifi_credentials_helper
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/wifi_credentials_helper_chromeos.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698