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/autocomplete/keyword_extensions_delegate_impl.h" | 5 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 8 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 bool KeywordExtensionsDelegateImpl::IsEnabledExtension( | 52 bool KeywordExtensionsDelegateImpl::IsEnabledExtension( |
53 const std::string& extension_id) { | 53 const std::string& extension_id) { |
54 ExtensionService* extension_service = | 54 ExtensionService* extension_service = |
55 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 55 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
56 const extensions::Extension* extension = | 56 const extensions::Extension* extension = |
57 extension_service->GetExtensionById(extension_id, false); | 57 extension_service->GetExtensionById(extension_id, false); |
58 return extension && | 58 return extension && |
59 (!profile_->IsOffTheRecord() || | 59 (!profile_->IsOffTheRecord() || |
60 !extensions::util::IsIncognitoEnabled(extension_id, profile_)); | 60 extensions::util::IsIncognitoEnabled(extension_id, profile_)); |
61 } | 61 } |
62 | 62 |
63 bool KeywordExtensionsDelegateImpl::Start( | 63 bool KeywordExtensionsDelegateImpl::Start( |
64 const AutocompleteInput& input, | 64 const AutocompleteInput& input, |
65 bool minimal_changes, | 65 bool minimal_changes, |
66 const TemplateURL* template_url, | 66 const TemplateURL* template_url, |
67 const base::string16& remaining_input) { | 67 const base::string16& remaining_input) { |
68 DCHECK(template_url); | 68 DCHECK(template_url); |
69 | 69 |
70 if (input.want_asynchronous_matches()) { | 70 if (input.want_asynchronous_matches()) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 default: | 205 default: |
206 NOTREACHED(); | 206 NOTREACHED(); |
207 return; | 207 return; |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 void KeywordExtensionsDelegateImpl::OnProviderUpdate(bool updated_matches) { | 211 void KeywordExtensionsDelegateImpl::OnProviderUpdate(bool updated_matches) { |
212 provider_->listener_->OnProviderUpdate(updated_matches); | 212 provider_->listener_->OnProviderUpdate(updated_matches); |
213 } | 213 } |
OLD | NEW |