OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/search_engines/template_url_service_client_impl.h" | 5 #include "ios/chrome/browser/search_engines/template_url_service_client_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "components/history/core/browser/history_service.h" | 9 #include "components/history/core/browser/history_service.h" |
10 #include "components/history/core/browser/history_types.h" | 10 #include "components/history/core/browser/history_types.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 } | 61 } |
62 | 62 |
63 void TemplateURLServiceClientImpl::AddKeywordGeneratedVisit(const GURL& url) { | 63 void TemplateURLServiceClientImpl::AddKeywordGeneratedVisit(const GURL& url) { |
64 if (history_service_) { | 64 if (history_service_) { |
65 history_service_->AddPage( | 65 history_service_->AddPage( |
66 url, base::Time::Now(), nullptr, 0, GURL(), history::RedirectList(), | 66 url, base::Time::Now(), nullptr, 0, GURL(), history::RedirectList(), |
67 ui::PAGE_TRANSITION_KEYWORD_GENERATED, history::SOURCE_BROWSED, false); | 67 ui::PAGE_TRANSITION_KEYWORD_GENERATED, history::SOURCE_BROWSED, false); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 void TemplateURLServiceClientImpl::RestoreExtensionInfoIfNecessary( | 71 bool TemplateURLServiceClientImpl::IsOmniboxExtensionURL( |
72 TemplateURL* template_url) { | 72 const std::string& url) { |
73 // iOS does not supports extension, nothing to do. | 73 // iOS does not supports extension. |
Peter Kasting
2016/10/05 00:15:21
Nit: "iOS does not support extensions."
vasilii
2016/10/05 12:03:48
Done.
| |
74 return false; | |
74 } | 75 } |
75 | 76 |
76 void TemplateURLServiceClientImpl::OnURLVisited( | 77 void TemplateURLServiceClientImpl::OnURLVisited( |
77 history::HistoryService* history_service, | 78 history::HistoryService* history_service, |
78 ui::PageTransition transition, | 79 ui::PageTransition transition, |
79 const history::URLRow& row, | 80 const history::URLRow& row, |
80 const history::RedirectList& redirects, | 81 const history::RedirectList& redirects, |
81 base::Time visit_time) { | 82 base::Time visit_time) { |
82 DCHECK_EQ(history_service, history_service_); | 83 DCHECK_EQ(history_service, history_service_); |
83 if (!owner_) | 84 if (!owner_) |
84 return; | 85 return; |
85 | 86 |
86 TemplateURLService::URLVisitedDetails details = { | 87 TemplateURLService::URLVisitedDetails details = { |
87 row.url(), | 88 row.url(), |
88 ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_KEYWORD), | 89 ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_KEYWORD), |
89 }; | 90 }; |
90 owner_->OnHistoryURLVisited(details); | 91 owner_->OnHistoryURLVisited(details); |
91 } | 92 } |
92 | 93 |
93 } // namespace ios | 94 } // namespace ios |
OLD | NEW |