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

Side by Side Diff: chrome/browser/extensions/api/copresence/copresence_api.h

Issue 469883002: Using API key specified from js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 6 years, 4 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 private: 49 private:
50 friend class BrowserContextKeyedAPIFactory<CopresenceService>; 50 friend class BrowserContextKeyedAPIFactory<CopresenceService>;
51 51
52 // CopresenceClientDelegate overrides: 52 // CopresenceClientDelegate overrides:
53 virtual void HandleMessages( 53 virtual void HandleMessages(
54 const std::string& app_id, 54 const std::string& app_id,
55 const std::string& subscription_id, 55 const std::string& subscription_id,
56 const std::vector<copresence::Message>& message) OVERRIDE; 56 const std::vector<copresence::Message>& message) OVERRIDE;
57 virtual net::URLRequestContextGetter* GetRequestContext() const OVERRIDE; 57 virtual net::URLRequestContextGetter* GetRequestContext() const OVERRIDE;
58 virtual const std::string GetPlatformVersionString() const OVERRIDE; 58 virtual const copresence::DeviceFingerprint& GetDeviceFingerprint() const
59 OVERRIDE;
60 virtual const std::string& GetAPIKey() const OVERRIDE;
59 virtual copresence::WhispernetClient* GetWhispernetClient() OVERRIDE; 61 virtual copresence::WhispernetClient* GetWhispernetClient() OVERRIDE;
60 62
61 // BrowserContextKeyedAPI implementation. 63 // BrowserContextKeyedAPI implementation.
62 static const char* service_name() { return "CopresenceService"; } 64 static const char* service_name() { return "CopresenceService"; }
63 65
64 bool is_shutting_down_; 66 bool is_shutting_down_;
65 std::map<std::string, std::string> apps_by_subscription_id_; 67 std::map<std::string, std::string> apps_by_subscription_id_;
66 68
67 content::BrowserContext* const browser_context_; 69 content::BrowserContext* const browser_context_;
70 copresence::DeviceFingerprint device_fingerprint_;
71 std::string api_key_;
72
68 scoped_ptr<copresence::CopresenceClient> client_; 73 scoped_ptr<copresence::CopresenceClient> client_;
69 scoped_ptr<copresence::WhispernetClient> whispernet_client_; 74 scoped_ptr<copresence::WhispernetClient> whispernet_client_;
70 75
71 DISALLOW_COPY_AND_ASSIGN(CopresenceService); 76 DISALLOW_COPY_AND_ASSIGN(CopresenceService);
72 }; 77 };
73 78
74 template <> 79 template <>
75 void BrowserContextKeyedAPIFactory< 80 void BrowserContextKeyedAPIFactory<
76 CopresenceService>::DeclareFactoryDependencies(); 81 CopresenceService>::DeclareFactoryDependencies();
77 82
(...skipping 14 matching lines...) Expand all
92 DECLARE_EXTENSION_FUNCTION("copresence.setApiKey", COPRESENCE_SETAPIKEY); 97 DECLARE_EXTENSION_FUNCTION("copresence.setApiKey", COPRESENCE_SETAPIKEY);
93 98
94 protected: 99 protected:
95 virtual ~CopresenceSetApiKeyFunction() {} 100 virtual ~CopresenceSetApiKeyFunction() {}
96 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; 101 virtual ExtensionFunction::ResponseAction Run() OVERRIDE;
97 }; 102 };
98 103
99 } // namespace extensions 104 } // namespace extensions
100 105
101 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ 106 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence/copresence_api.cc » ('j') | components/copresence/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698