| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/history/core/browser/web_history_service.h" | 5 #include "components/history/core/browser/web_history_service.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/optional.h" | 14 #include "base/optional.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "components/signin/core/browser/signin_manager.h" | 19 #include "components/signin/core/browser/signin_manager.h" |
| 20 #include "components/sync/protocol/history_status.pb.h" |
| 20 #include "components/sync_driver/sync_util.h" | 21 #include "components/sync_driver/sync_util.h" |
| 21 #include "google_apis/gaia/gaia_urls.h" | 22 #include "google_apis/gaia/gaia_urls.h" |
| 22 #include "google_apis/gaia/google_service_auth_error.h" | 23 #include "google_apis/gaia/google_service_auth_error.h" |
| 23 #include "google_apis/gaia/oauth2_token_service.h" | 24 #include "google_apis/gaia/oauth2_token_service.h" |
| 24 #include "net/base/load_flags.h" | 25 #include "net/base/load_flags.h" |
| 25 #include "net/base/url_util.h" | 26 #include "net/base/url_util.h" |
| 26 #include "net/http/http_status_code.h" | 27 #include "net/http/http_status_code.h" |
| 27 #include "net/http/http_util.h" | 28 #include "net/http/http_util.h" |
| 28 #include "net/url_request/url_fetcher.h" | 29 #include "net/url_request/url_fetcher.h" |
| 29 #include "net/url_request/url_fetcher_delegate.h" | 30 #include "net/url_request/url_fetcher_delegate.h" |
| 30 #include "net/url_request/url_request_context_getter.h" | 31 #include "net/url_request/url_request_context_getter.h" |
| 31 #include "sync/protocol/history_status.pb.h" | |
| 32 #include "ui/base/device_form_factor.h" | 32 #include "ui/base/device_form_factor.h" |
| 33 #include "url/gurl.h" | 33 #include "url/gurl.h" |
| 34 | 34 |
| 35 namespace history { | 35 namespace history { |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 const char kHistoryOAuthScope[] = | 39 const char kHistoryOAuthScope[] = |
| 40 "https://www.googleapis.com/auth/chromesync"; | 40 "https://www.googleapis.com/auth/chromesync"; |
| 41 | 41 |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 if (success && request->GetResponseCode() == net::HTTP_OK) { | 608 if (success && request->GetResponseCode() == net::HTTP_OK) { |
| 609 sync_pb::HistoryStatusResponse history_status; | 609 sync_pb::HistoryStatusResponse history_status; |
| 610 if (history_status.ParseFromString(request->GetResponseBody())) | 610 if (history_status.ParseFromString(request->GetResponseBody())) |
| 611 has_other_forms_of_browsing_history = history_status.has_derived_data(); | 611 has_other_forms_of_browsing_history = history_status.has_derived_data(); |
| 612 } | 612 } |
| 613 | 613 |
| 614 callback.Run(has_other_forms_of_browsing_history); | 614 callback.Run(has_other_forms_of_browsing_history); |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace history | 617 } // namespace history |
| OLD | NEW |