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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 omnibox_icon_manager_.set_monochrome(true); | 187 omnibox_icon_manager_.set_monochrome(true); |
188 } | 188 } |
189 | 189 |
190 void OmniboxAPI::Shutdown() { | 190 void OmniboxAPI::Shutdown() { |
191 template_url_sub_.reset(); | 191 template_url_sub_.reset(); |
192 } | 192 } |
193 | 193 |
194 OmniboxAPI::~OmniboxAPI() { | 194 OmniboxAPI::~OmniboxAPI() { |
195 } | 195 } |
196 | 196 |
197 static base::LazyInstance<BrowserContextKeyedAPIFactory<OmniboxAPI> > | 197 static base::LazyInstance< |
198 g_factory = LAZY_INSTANCE_INITIALIZER; | 198 BrowserContextKeyedAPIFactory<OmniboxAPI>>::DestructorAtExit g_factory = |
| 199 LAZY_INSTANCE_INITIALIZER; |
199 | 200 |
200 // static | 201 // static |
201 BrowserContextKeyedAPIFactory<OmniboxAPI>* OmniboxAPI::GetFactoryInstance() { | 202 BrowserContextKeyedAPIFactory<OmniboxAPI>* OmniboxAPI::GetFactoryInstance() { |
202 return g_factory.Pointer(); | 203 return g_factory.Pointer(); |
203 } | 204 } |
204 | 205 |
205 // static | 206 // static |
206 OmniboxAPI* OmniboxAPI::Get(content::BrowserContext* context) { | 207 OmniboxAPI* OmniboxAPI::Get(content::BrowserContext* context) { |
207 return BrowserContextKeyedAPIFactory<OmniboxAPI>::Get(context); | 208 return BrowserContextKeyedAPIFactory<OmniboxAPI>::Get(context); |
208 } | 209 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 for (size_t i = 0; i < description_styles.size(); ++i) { | 376 for (size_t i = 0; i < description_styles.size(); ++i) { |
376 if (description_styles[i].offset > placeholder) | 377 if (description_styles[i].offset > placeholder) |
377 description_styles[i].offset += replacement.length() - 2; | 378 description_styles[i].offset += replacement.length() - 2; |
378 } | 379 } |
379 } | 380 } |
380 | 381 |
381 match->contents.assign(description); | 382 match->contents.assign(description); |
382 } | 383 } |
383 | 384 |
384 } // namespace extensions | 385 } // namespace extensions |
OLD | NEW |