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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 const Extension* extension = | 146 const Extension* extension = |
147 ExtensionRegistry::Get(profile)->enabled_extensions().GetByID( | 147 ExtensionRegistry::Get(profile)->enabled_extensions().GetByID( |
148 extension_id); | 148 extension_id); |
149 CHECK(extension); | 149 CHECK(extension); |
150 extensions::TabHelper::FromWebContents(web_contents)-> | 150 extensions::TabHelper::FromWebContents(web_contents)-> |
151 active_tab_permission_granter()->GrantIfRequested(extension); | 151 active_tab_permission_granter()->GrantIfRequested(extension); |
152 | 152 |
153 std::unique_ptr<base::ListValue> args(new base::ListValue()); | 153 std::unique_ptr<base::ListValue> args(new base::ListValue()); |
154 args->Set(0, new base::StringValue(input)); | 154 args->Set(0, new base::StringValue(input)); |
155 if (disposition == NEW_FOREGROUND_TAB) | 155 if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) |
156 args->Set(1, new base::StringValue(kForegroundTabDisposition)); | 156 args->Set(1, new base::StringValue(kForegroundTabDisposition)); |
157 else if (disposition == NEW_BACKGROUND_TAB) | 157 else if (disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB) |
158 args->Set(1, new base::StringValue(kBackgroundTabDisposition)); | 158 args->Set(1, new base::StringValue(kBackgroundTabDisposition)); |
159 else | 159 else |
160 args->Set(1, new base::StringValue(kCurrentTabDisposition)); | 160 args->Set(1, new base::StringValue(kCurrentTabDisposition)); |
161 | 161 |
162 std::unique_ptr<Event> event = base::MakeUnique<Event>( | 162 std::unique_ptr<Event> event = base::MakeUnique<Event>( |
163 events::OMNIBOX_ON_INPUT_ENTERED, omnibox::OnInputEntered::kEventName, | 163 events::OMNIBOX_ON_INPUT_ENTERED, omnibox::OnInputEntered::kEventName, |
164 std::move(args)); | 164 std::move(args)); |
165 event->restrict_to_browser_context = profile; | 165 event->restrict_to_browser_context = profile; |
166 EventRouter::Get(profile) | 166 EventRouter::Get(profile) |
167 ->DispatchEventToExtension(extension_id, std::move(event)); | 167 ->DispatchEventToExtension(extension_id, std::move(event)); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 for (size_t i = 0; i < description_styles.size(); ++i) { | 393 for (size_t i = 0; i < description_styles.size(); ++i) { |
394 if (description_styles[i].offset > placeholder) | 394 if (description_styles[i].offset > placeholder) |
395 description_styles[i].offset += replacement.length() - 2; | 395 description_styles[i].offset += replacement.length() - 2; |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 match->contents.assign(description); | 399 match->contents.assign(description); |
400 } | 400 } |
401 | 401 |
402 } // namespace extensions | 402 } // namespace extensions |
OLD | NEW |