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

Side by Side Diff: chrome/browser/local_discovery/privet_http.h

Issue 1417363004: Verify certificate of Privet v3 device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/browser/local_discovery/privet_http_impl.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const PrivetJSONOperation::ResultCallback& callback) = 0; 55 const PrivetJSONOperation::ResultCallback& callback) = 0;
56 56
57 // Creates a URL fetcher for PrivetV1. 57 // Creates a URL fetcher for PrivetV1.
58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher( 58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher(
59 const GURL& url, 59 const GURL& url,
60 net::URLFetcher::RequestType request_type, 60 net::URLFetcher::RequestType request_type,
61 PrivetURLFetcher::Delegate* delegate) = 0; 61 PrivetURLFetcher::Delegate* delegate) = 0;
62 62
63 virtual void RefreshPrivetToken( 63 virtual void RefreshPrivetToken(
64 const PrivetURLFetcher::TokenCallback& token_callback) = 0; 64 const PrivetURLFetcher::TokenCallback& token_callback) = 0;
65
66 // After this call HTTPS will be used. Only requests to the server with
67 // matching certificate will be allowed.
68 virtual void SwitchToHttps(
69 uint16_t port,
70 const net::SHA256HashValue& certificate_fingerprint) = 0;
71
72 virtual bool IsInHttpsMode() const = 0;
65 }; 73 };
66 74
67 class PrivetDataReadOperation { 75 class PrivetDataReadOperation {
68 public: 76 public:
69 enum ResponseType { 77 enum ResponseType {
70 RESPONSE_TYPE_ERROR, 78 RESPONSE_TYPE_ERROR,
71 RESPONSE_TYPE_STRING, 79 RESPONSE_TYPE_STRING,
72 RESPONSE_TYPE_FILE 80 RESPONSE_TYPE_FILE
73 }; 81 };
74 82
(...skipping 19 matching lines...) Expand all
94 // complete action. Some intervention from the caller is required to display the 102 // complete action. Some intervention from the caller is required to display the
95 // claim URL to the user (noted in OnPrivetRegisterClaimURL). 103 // claim URL to the user (noted in OnPrivetRegisterClaimURL).
96 class PrivetRegisterOperation { 104 class PrivetRegisterOperation {
97 public: 105 public:
98 enum FailureReason { 106 enum FailureReason {
99 FAILURE_NETWORK, 107 FAILURE_NETWORK,
100 FAILURE_HTTP_ERROR, 108 FAILURE_HTTP_ERROR,
101 FAILURE_JSON_ERROR, 109 FAILURE_JSON_ERROR,
102 FAILURE_MALFORMED_RESPONSE, 110 FAILURE_MALFORMED_RESPONSE,
103 FAILURE_TOKEN, 111 FAILURE_TOKEN,
104 FAILURE_RETRY 112 FAILURE_UNKNOWN,
105 }; 113 };
106 114
107 class Delegate { 115 class Delegate {
108 public: 116 public:
109 ~Delegate() {} 117 ~Delegate() {}
110 118
111 // Called when a user needs to claim the printer by visiting the given URL. 119 // Called when a user needs to claim the printer by visiting the given URL.
112 virtual void OnPrivetRegisterClaimToken( 120 virtual void OnPrivetRegisterClaimToken(
113 PrivetRegisterOperation* operation, 121 PrivetRegisterOperation* operation,
114 const std::string& token, 122 const std::string& token,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( 213 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation(
206 const PrivetJSONOperation::ResultCallback& callback) = 0; 214 const PrivetJSONOperation::ResultCallback& callback) = 0;
207 215
208 // Creates operation to submit print job to local printer. 216 // Creates operation to submit print job to local printer.
209 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( 217 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation(
210 PrivetLocalPrintOperation::Delegate* delegate) = 0; 218 PrivetLocalPrintOperation::Delegate* delegate) = 0;
211 }; 219 };
212 220
213 } // namespace local_discovery 221 } // namespace local_discovery
214 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 222 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_http_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698