| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/omnibox/omnibox_api.h" | 5 #include "chrome/browser/extensions/api/omnibox/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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace extensions { | 30 namespace extensions { |
| 31 | 31 |
| 32 namespace omnibox = api::omnibox; | 32 namespace omnibox = api::omnibox; |
| 33 namespace SendSuggestions = omnibox::SendSuggestions; | 33 namespace SendSuggestions = omnibox::SendSuggestions; |
| 34 namespace SetDefaultSuggestion = omnibox::SetDefaultSuggestion; | 34 namespace SetDefaultSuggestion = omnibox::SetDefaultSuggestion; |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 const char kSuggestionContent[] = "content"; | 38 const char kSuggestionContent[] = "content"; |
| 39 const char kSuggestionDescription[] = "description"; | |
| 40 const char kSuggestionDescriptionStyles[] = "descriptionStyles"; | |
| 41 const char kSuggestionDescriptionStylesRaw[] = "descriptionStylesRaw"; | |
| 42 const char kDescriptionStylesType[] = "type"; | |
| 43 const char kDescriptionStylesOffset[] = "offset"; | |
| 44 const char kDescriptionStylesLength[] = "length"; | |
| 45 const char kCurrentTabDisposition[] = "currentTab"; | 39 const char kCurrentTabDisposition[] = "currentTab"; |
| 46 const char kForegroundTabDisposition[] = "newForegroundTab"; | 40 const char kForegroundTabDisposition[] = "newForegroundTab"; |
| 47 const char kBackgroundTabDisposition[] = "newBackgroundTab"; | 41 const char kBackgroundTabDisposition[] = "newBackgroundTab"; |
| 48 | 42 |
| 49 // Pref key for omnibox.setDefaultSuggestion. | 43 // Pref key for omnibox.setDefaultSuggestion. |
| 50 const char kOmniboxDefaultSuggestion[] = "omnibox_default_suggestion"; | 44 const char kOmniboxDefaultSuggestion[] = "omnibox_default_suggestion"; |
| 51 | 45 |
| 52 #if defined(OS_LINUX) | 46 #if defined(OS_LINUX) |
| 53 static const int kOmniboxIconPaddingLeft = 2; | 47 static const int kOmniboxIconPaddingLeft = 2; |
| 54 static const int kOmniboxIconPaddingRight = 2; | 48 static const int kOmniboxIconPaddingRight = 2; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 for (size_t i = 0; i < description_styles.size(); ++i) { | 388 for (size_t i = 0; i < description_styles.size(); ++i) { |
| 395 if (description_styles[i].offset > placeholder) | 389 if (description_styles[i].offset > placeholder) |
| 396 description_styles[i].offset += replacement.length() - 2; | 390 description_styles[i].offset += replacement.length() - 2; |
| 397 } | 391 } |
| 398 } | 392 } |
| 399 | 393 |
| 400 match->contents.assign(description); | 394 match->contents.assign(description); |
| 401 } | 395 } |
| 402 | 396 |
| 403 } // namespace extensions | 397 } // namespace extensions |
| OLD | NEW |