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/lazy_instance.h" | 8 #include "base/lazy_instance.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" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 string16 replacement = | 254 string16 replacement = |
255 remaining_input.empty() ? kReplacementText : remaining_input; | 255 remaining_input.empty() ? kReplacementText : remaining_input; |
256 description.replace(placeholder, kPlaceholderText.length(), replacement); | 256 description.replace(placeholder, kPlaceholderText.length(), replacement); |
257 | 257 |
258 for (size_t i = 0; i < description_styles.size(); ++i) { | 258 for (size_t i = 0; i < description_styles.size(); ++i) { |
259 if (description_styles[i].offset > placeholder) | 259 if (description_styles[i].offset > placeholder) |
260 description_styles[i].offset += replacement.length() - 2; | 260 description_styles[i].offset += replacement.length() - 2; |
261 } | 261 } |
262 } | 262 } |
263 | 263 |
264 match->contents.assign(UTF16ToWide(description)); | 264 match->contents.assign(description); |
265 } | 265 } |
OLD | NEW |