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

Side by Side Diff: chrome/browser/local_discovery/privetv3_session.cc

Issue 874163002: Added ultrasound32 and audible32 into gcd_private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patches
Patch Set: Fri Jan 30 02:27:36 PST 2015 Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/gcd_private.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/local_discovery/privetv3_session.h" 5 #include "chrome/browser/local_discovery/privetv3_session.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 static const Element kMap[]; 80 static const Element kMap[];
81 }; 81 };
82 82
83 using PairingType = PrivetV3Session::PairingType; 83 using PairingType = PrivetV3Session::PairingType;
84 84
85 template <> 85 template <>
86 const EnumToStringMap<PrivetV3Session::PairingType>::Element 86 const EnumToStringMap<PrivetV3Session::PairingType>::Element
87 EnumToStringMap<PrivetV3Session::PairingType>::kMap[] = { 87 EnumToStringMap<PrivetV3Session::PairingType>::kMap[] = {
88 {PairingType::PAIRING_TYPE_PINCODE, "pinCode"}, 88 {PairingType::PAIRING_TYPE_PINCODE, "pinCode"},
89 {PairingType::PAIRING_TYPE_EMBEDDEDCODE, "embeddedCode"}, 89 {PairingType::PAIRING_TYPE_EMBEDDEDCODE, "embeddedCode"},
90 {PairingType::PAIRING_TYPE_ULTRASOUND32, "ultrasound32"},
91 {PairingType::PAIRING_TYPE_AUDIBLE32, "audible32"},
90 }; 92 };
91 93
92 template <typename T> 94 template <typename T>
93 std::string EnumToString(T id) { 95 std::string EnumToString(T id) {
94 return EnumToStringMap<T>::FindNameById(id); 96 return EnumToStringMap<T>::FindNameById(id);
95 } 97 }
96 98
97 template <typename T> 99 template <typename T>
98 bool StringToEnum(const std::string& name, T* id) { 100 bool StringToEnum(const std::string& name, T* id) {
99 return EnumToStringMap<T>::FindIdByName(name, id); 101 return EnumToStringMap<T>::FindIdByName(name, id);
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 fetchers_.push_back(new FetcherDelegate(weak_ptr_factory_.GetWeakPtr(), 391 fetchers_.push_back(new FetcherDelegate(weak_ptr_factory_.GetWeakPtr(),
390 privet_auth_token_, callback)); 392 privet_auth_token_, callback));
391 return fetchers_.back()->CreateURLFetcher(CreatePrivetURL(api), request_type); 393 return fetchers_.back()->CreateURLFetcher(CreatePrivetURL(api), request_type);
392 } 394 }
393 395
394 void PrivetV3Session::DeleteFetcher(const FetcherDelegate* fetcher) { 396 void PrivetV3Session::DeleteFetcher(const FetcherDelegate* fetcher) {
395 fetchers_.erase(std::find(fetchers_.begin(), fetchers_.end(), fetcher)); 397 fetchers_.erase(std::find(fetchers_.begin(), fetchers_.end(), fetcher));
396 } 398 }
397 399
398 } // namespace local_discovery 400 } // namespace local_discovery
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/gcd_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698