| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_provider.h" | 5 #include "chrome/browser/autocomplete/keyword_provider.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" | 
| 11 #include "base/string16.h" | 11 #include "base/string16.h" | 
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" | 
| 13 #include "chrome/browser/autocomplete/autocomplete_match.h" | 13 #include "chrome/browser/autocomplete/autocomplete_match.h" | 
| 14 #include "chrome/browser/extensions/extension_omnibox_api.h" | 14 #include "chrome/browser/extensions/extension_omnibox_api.h" | 
| 15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" | 
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" | 
| 17 #include "chrome/browser/search_engines/template_url.h" | 17 #include "chrome/browser/search_engines/template_url.h" | 
| 18 #include "chrome/browser/search_engines/template_url_model.h" | 18 #include "chrome/browser/search_engines/template_url_model.h" | 
| 19 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_details.h" | 
|  | 20 #include "chrome/common/notification_source.h" | 
| 20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" | 
| 21 #include "net/base/escape.h" | 22 #include "net/base/escape.h" | 
| 22 #include "net/base/net_util.h" | 23 #include "net/base/net_util.h" | 
| 23 | 24 | 
| 24 // Helper functor for Start(), for ending keyword mode unless explicitly told | 25 // Helper functor for Start(), for ending keyword mode unless explicitly told | 
| 25 // otherwise. | 26 // otherwise. | 
| 26 class KeywordProvider::ScopedEndExtensionKeywordMode { | 27 class KeywordProvider::ScopedEndExtensionKeywordMode { | 
| 27  public: | 28  public: | 
| 28   explicit ScopedEndExtensionKeywordMode(KeywordProvider* provider) | 29   explicit ScopedEndExtensionKeywordMode(KeywordProvider* provider) | 
| 29       : provider_(provider) { } | 30       : provider_(provider) { } | 
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 520 } | 521 } | 
| 521 | 522 | 
| 522 void KeywordProvider::MaybeEndExtensionKeywordMode() { | 523 void KeywordProvider::MaybeEndExtensionKeywordMode() { | 
| 523   if (!current_keyword_extension_id_.empty()) { | 524   if (!current_keyword_extension_id_.empty()) { | 
| 524     ExtensionOmniboxEventRouter::OnInputCancelled( | 525     ExtensionOmniboxEventRouter::OnInputCancelled( | 
| 525         profile_, current_keyword_extension_id_); | 526         profile_, current_keyword_extension_id_); | 
| 526 | 527 | 
| 527     current_keyword_extension_id_.clear(); | 528     current_keyword_extension_id_.clear(); | 
| 528   } | 529   } | 
| 529 } | 530 } | 
| OLD | NEW | 
|---|