Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/string16.h" 10 #include "base/string16.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 events::kOnInputCancelled, make_scoped_ptr(new ListValue()))); 125 events::kOnInputCancelled, make_scoped_ptr(new ListValue())));
126 event->restrict_to_profile = profile; 126 event->restrict_to_profile = profile;
127 ExtensionSystem::Get(profile)->event_router()-> 127 ExtensionSystem::Get(profile)->event_router()->
128 DispatchEventToExtension(extension_id, event.Pass()); 128 DispatchEventToExtension(extension_id, event.Pass());
129 } 129 }
130 130
131 OmniboxAPI::OmniboxAPI(Profile* profile) 131 OmniboxAPI::OmniboxAPI(Profile* profile)
132 : profile_(profile), 132 : profile_(profile),
133 url_service_(TemplateURLServiceFactory::GetForProfile(profile)) { 133 url_service_(TemplateURLServiceFactory::GetForProfile(profile)) {
134 ManifestHandler::Register(extension_manifest_keys::kOmnibox, 134 ManifestHandler::Register(extension_manifest_keys::kOmnibox,
135 new OmniboxHandler); 135 make_linked_ptr(new OmniboxHandler));
136 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 136 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
137 content::Source<Profile>(profile)); 137 content::Source<Profile>(profile));
138 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 138 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
139 content::Source<Profile>(profile)); 139 content::Source<Profile>(profile));
140 if (url_service_) { 140 if (url_service_) {
141 registrar_.Add(this, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, 141 registrar_.Add(this, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
142 content::Source<TemplateURLService>(url_service_)); 142 content::Source<TemplateURLService>(url_service_));
143 } 143 }
144 144
145 // Use monochrome icons for Omnibox icons. 145 // Use monochrome icons for Omnibox icons.
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 for (size_t i = 0; i < description_styles.size(); ++i) { 416 for (size_t i = 0; i < description_styles.size(); ++i) {
417 if (description_styles[i].offset > placeholder) 417 if (description_styles[i].offset > placeholder)
418 description_styles[i].offset += replacement.length() - 2; 418 description_styles[i].offset += replacement.length() - 2;
419 } 419 }
420 } 420 }
421 421
422 match->contents.assign(description); 422 match->contents.assign(description);
423 } 423 }
424 424
425 } // namespace extensions 425 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/input_ime/input_ime_api.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698