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

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

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698