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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_event_router.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/tabs_event_router.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
index 5c430ef3aebe361e2cf0c16e5542207a1dee058d..efaab12f5a6e04b5d60355a9d1457efa3076286f 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -228,7 +228,7 @@ void TabsEventRouter::TabInsertedAt(WebContents* contents,
int tab_id = ExtensionTabUtil::GetTabId(contents);
std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->Append(new FundamentalValue(tab_id));
+ args->AppendInteger(tab_id);
base::DictionaryValue* object_args = new base::DictionaryValue();
object_args->Set(tabs_constants::kNewWindowIdKey,
@@ -250,8 +250,7 @@ void TabsEventRouter::TabDetachedAt(WebContents* contents, int index) {
}
std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->Append(
- new FundamentalValue(ExtensionTabUtil::GetTabId(contents)));
+ args->AppendInteger(ExtensionTabUtil::GetTabId(contents));
base::DictionaryValue* object_args = new base::DictionaryValue();
object_args->Set(tabs_constants::kOldWindowIdKey,
@@ -272,7 +271,7 @@ void TabsEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
int tab_id = ExtensionTabUtil::GetTabId(contents);
std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->Append(new FundamentalValue(tab_id));
+ args->AppendInteger(tab_id);
base::DictionaryValue* object_args = new base::DictionaryValue();
object_args->SetInteger(tabs_constants::kWindowIdKey,
@@ -294,7 +293,7 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
int reason) {
std::unique_ptr<base::ListValue> args(new base::ListValue);
int tab_id = ExtensionTabUtil::GetTabId(new_contents);
- args->Append(new FundamentalValue(tab_id));
+ args->AppendInteger(tab_id);
base::DictionaryValue* object_args = new base::DictionaryValue();
object_args->Set(tabs_constants::kWindowIdKey,
@@ -338,7 +337,7 @@ void TabsEventRouter::TabSelectionChanged(
if (!contents)
break;
int tab_id = ExtensionTabUtil::GetTabId(contents);
- all_tabs->Append(new FundamentalValue(tab_id));
+ all_tabs->AppendInteger(tab_id);
}
std::unique_ptr<base::ListValue> args(new base::ListValue);
@@ -367,8 +366,7 @@ void TabsEventRouter::TabMoved(WebContents* contents,
int from_index,
int to_index) {
std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->Append(
- new FundamentalValue(ExtensionTabUtil::GetTabId(contents)));
+ args->AppendInteger(ExtensionTabUtil::GetTabId(contents));
base::DictionaryValue* object_args = new base::DictionaryValue();
object_args->Set(tabs_constants::kWindowIdKey,
@@ -486,8 +484,8 @@ void TabsEventRouter::TabReplacedAt(TabStripModel* tab_strip_model,
const int new_tab_id = ExtensionTabUtil::GetTabId(new_contents);
const int old_tab_id = ExtensionTabUtil::GetTabId(old_contents);
std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->Append(new FundamentalValue(new_tab_id));
- args->Append(new FundamentalValue(old_tab_id));
+ args->AppendInteger(new_tab_id);
+ args->AppendInteger(old_tab_id);
DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()),
events::TABS_ON_REPLACED, tabs::OnReplaced::kEventName,

Powered by Google App Engine
This is Rietveld 408576698