OLD | NEW |
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/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/local_discovery/privet_http.h" | 10 #include "chrome/browser/local_discovery/privet_http.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 class PrivetV3Session::FetcherDelegate : public PrivetURLFetcher::Delegate { | 30 class PrivetV3Session::FetcherDelegate : public PrivetURLFetcher::Delegate { |
31 public: | 31 public: |
32 FetcherDelegate(const base::WeakPtr<PrivetV3Session>& session, | 32 FetcherDelegate(const base::WeakPtr<PrivetV3Session>& session, |
33 Request* request); | 33 Request* request); |
34 virtual ~FetcherDelegate(); | 34 virtual ~FetcherDelegate(); |
35 | 35 |
36 // PrivetURLFetcher::Delegate methods. | 36 // PrivetURLFetcher::Delegate methods. |
37 virtual void OnNeedPrivetToken( | 37 virtual void OnNeedPrivetToken( |
38 PrivetURLFetcher* fetcher, | 38 PrivetURLFetcher* fetcher, |
39 const PrivetURLFetcher::TokenCallback& callback) OVERRIDE; | 39 const PrivetURLFetcher::TokenCallback& callback) override; |
40 virtual void OnError(PrivetURLFetcher* fetcher, | 40 virtual void OnError(PrivetURLFetcher* fetcher, |
41 PrivetURLFetcher::ErrorType error) OVERRIDE; | 41 PrivetURLFetcher::ErrorType error) override; |
42 virtual void OnParsedJson(PrivetURLFetcher* fetcher, | 42 virtual void OnParsedJson(PrivetURLFetcher* fetcher, |
43 const base::DictionaryValue& value, | 43 const base::DictionaryValue& value, |
44 bool has_error) OVERRIDE; | 44 bool has_error) override; |
45 | 45 |
46 private: | 46 private: |
47 friend class PrivetV3Session; | 47 friend class PrivetV3Session; |
48 scoped_ptr<PrivetURLFetcher> url_fetcher_; | 48 scoped_ptr<PrivetURLFetcher> url_fetcher_; |
49 base::WeakPtr<PrivetV3Session> session_; | 49 base::WeakPtr<PrivetV3Session> session_; |
50 Request* request_; | 50 Request* request_; |
51 }; | 51 }; |
52 | 52 |
53 PrivetV3Session::FetcherDelegate::FetcherDelegate( | 53 PrivetV3Session::FetcherDelegate::FetcherDelegate( |
54 const base::WeakPtr<PrivetV3Session>& session, | 54 const base::WeakPtr<PrivetV3Session>& session, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 request->fetcher_delegate_->url_fetcher_->Start(); | 137 request->fetcher_delegate_->url_fetcher_->Start(); |
138 } | 138 } |
139 | 139 |
140 void PrivetV3Session::ConfirmFakeCode() { | 140 void PrivetV3Session::ConfirmFakeCode() { |
141 delegate_->OnSetupConfirmationNeeded( | 141 delegate_->OnSetupConfirmationNeeded( |
142 kStubPrivetCode, | 142 kStubPrivetCode, |
143 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); | 143 extensions::api::gcd_private::CONFIRMATION_TYPE_DISPLAYCODE); |
144 } | 144 } |
145 | 145 |
146 } // namespace local_discovery | 146 } // namespace local_discovery |
OLD | NEW |