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/extensions/extension_omnibox_api.h" | 5 #include "chrome/browser/extensions/extension_omnibox_api.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/extensions/extension_event_router.h" | 12 #include "chrome/browser/extensions/extension_event_router.h" |
13 #include "chrome/browser/extensions/extensions_service.h" | 13 #include "chrome/browser/extensions/extensions_service.h" |
14 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/search_engines/template_url.h" | 15 #include "chrome/browser/search_engines/template_url.h" |
16 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
17 | 17 |
18 namespace events { | 18 namespace events { |
19 const char kOnInputStarted[] = "omnibox.onInputStarted"; | 19 const char kOnInputStarted[] = "omnibox.onInputStarted"; |
20 const char kOnInputChanged[] = "omnibox.onInputChanged"; | 20 const char kOnInputChanged[] = "omnibox.onInputChanged"; |
21 const char kOnInputEntered[] = "omnibox.onInputEntered"; | 21 const char kOnInputEntered[] = "omnibox.onInputEntered"; |
22 const char kOnInputCancelled[] = "omnibox.onInputCancelled"; | 22 const char kOnInputCancelled[] = "omnibox.onInputCancelled"; |
23 }; // namespace events | 23 }; // namespace events |
24 | 24 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 description.replace(placeholder, kPlaceholderText.length(), replacement); | 248 description.replace(placeholder, kPlaceholderText.length(), replacement); |
249 | 249 |
250 for (size_t i = 0; i < description_styles.size(); ++i) { | 250 for (size_t i = 0; i < description_styles.size(); ++i) { |
251 if (description_styles[i].offset > placeholder) | 251 if (description_styles[i].offset > placeholder) |
252 description_styles[i].offset += replacement.length() - 2; | 252 description_styles[i].offset += replacement.length() - 2; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 match->contents.assign(UTF16ToWide(description)); | 256 match->contents.assign(UTF16ToWide(description)); |
257 } | 257 } |
OLD | NEW |