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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_event_router.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/tabs/tabs_event_router.h" 5 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 std::unique_ptr<base::ListValue> args(new base::ListValue); 343 std::unique_ptr<base::ListValue> args(new base::ListValue);
344 std::unique_ptr<base::DictionaryValue> select_info(new base::DictionaryValue); 344 std::unique_ptr<base::DictionaryValue> select_info(new base::DictionaryValue);
345 345
346 select_info->Set( 346 select_info->Set(
347 tabs_constants::kWindowIdKey, 347 tabs_constants::kWindowIdKey,
348 new FundamentalValue( 348 new FundamentalValue(
349 ExtensionTabUtil::GetWindowIdOfTabStripModel(tab_strip_model))); 349 ExtensionTabUtil::GetWindowIdOfTabStripModel(tab_strip_model)));
350 350
351 select_info->Set(tabs_constants::kTabIdsKey, all_tabs.release()); 351 select_info->Set(tabs_constants::kTabIdsKey, all_tabs.release());
352 args->Append(select_info.release()); 352 args->Append(std::move(select_info));
353 353
354 // The onHighlighted event replaced onHighlightChanged. 354 // The onHighlighted event replaced onHighlightChanged.
355 Profile* profile = tab_strip_model->profile(); 355 Profile* profile = tab_strip_model->profile();
356 DispatchEvent(profile, events::TABS_ON_HIGHLIGHT_CHANGED, 356 DispatchEvent(profile, events::TABS_ON_HIGHLIGHT_CHANGED,
357 tabs::OnHighlightChanged::kEventName, 357 tabs::OnHighlightChanged::kEventName,
358 std::unique_ptr<base::ListValue>(args->DeepCopy()), 358 std::unique_ptr<base::ListValue>(args->DeepCopy()),
359 EventRouter::USER_GESTURE_UNKNOWN); 359 EventRouter::USER_GESTURE_UNKNOWN);
360 DispatchEvent(profile, events::TABS_ON_HIGHLIGHTED, 360 DispatchEvent(profile, events::TABS_ON_HIGHLIGHTED,
361 tabs::OnHighlighted::kEventName, std::move(args), 361 tabs::OnHighlighted::kEventName, std::move(args),
362 EventRouter::USER_GESTURE_UNKNOWN); 362 EventRouter::USER_GESTURE_UNKNOWN);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 bool icon_url_changed, 541 bool icon_url_changed,
542 const gfx::Image& image) { 542 const gfx::Image& image) {
543 if (notification_icon_type == NON_TOUCH_16_DIP && icon_url_changed) { 543 if (notification_icon_type == NON_TOUCH_16_DIP && icon_url_changed) {
544 favicon::ContentFaviconDriver* content_favicon_driver = 544 favicon::ContentFaviconDriver* content_favicon_driver =
545 static_cast<favicon::ContentFaviconDriver*>(favicon_driver); 545 static_cast<favicon::ContentFaviconDriver*>(favicon_driver);
546 FaviconUrlUpdated(content_favicon_driver->web_contents()); 546 FaviconUrlUpdated(content_favicon_driver->web_contents());
547 } 547 }
548 } 548 }
549 549
550 } // namespace extensions 550 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698