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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 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 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 9fe585be6b03300366017e13fd27d092954921bf..6566c7b444bb14e3fe2c879e0793e54960f3e7d6 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -29,7 +29,7 @@
using base::DictionaryValue;
using base::ListValue;
-using base::FundamentalValue;
+using base::Value;
using content::WebContents;
using zoom::ZoomController;
@@ -238,10 +238,8 @@ void TabsEventRouter::TabInsertedAt(TabStripModel* tab_strip_model,
std::unique_ptr<base::DictionaryValue> object_args(
new base::DictionaryValue());
object_args->Set(tabs_constants::kNewWindowIdKey,
- new FundamentalValue(
- ExtensionTabUtil::GetWindowIdOfTab(contents)));
- object_args->Set(tabs_constants::kNewPositionKey,
- new FundamentalValue(index));
+ new Value(ExtensionTabUtil::GetWindowIdOfTab(contents)));
+ object_args->Set(tabs_constants::kNewPositionKey, new Value(index));
args->Append(std::move(object_args));
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
@@ -261,10 +259,8 @@ void TabsEventRouter::TabDetachedAt(WebContents* contents, int index) {
std::unique_ptr<base::DictionaryValue> object_args(
new base::DictionaryValue());
object_args->Set(tabs_constants::kOldWindowIdKey,
- new FundamentalValue(
- ExtensionTabUtil::GetWindowIdOfTab(contents)));
- object_args->Set(tabs_constants::kOldPositionKey,
- new FundamentalValue(index));
+ new Value(ExtensionTabUtil::GetWindowIdOfTab(contents)));
+ object_args->Set(tabs_constants::kOldPositionKey, new Value(index));
args->Append(std::move(object_args));
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
@@ -305,8 +301,7 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
auto object_args = base::MakeUnique<base::DictionaryValue>();
object_args->Set(tabs_constants::kWindowIdKey,
- new FundamentalValue(
- ExtensionTabUtil::GetWindowIdOfTab(new_contents)));
+ new Value(ExtensionTabUtil::GetWindowIdOfTab(new_contents)));
args->Append(object_args->CreateDeepCopy());
// The onActivated event replaced onActiveChanged and onSelectionChanged. The
@@ -325,8 +320,7 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
// The onActivated event takes one argument: {windowId, tabId}.
auto on_activated_args = base::MakeUnique<base::ListValue>();
- object_args->Set(tabs_constants::kTabIdKey,
- new FundamentalValue(tab_id));
+ object_args->Set(tabs_constants::kTabIdKey, new Value(tab_id));
on_activated_args->Append(std::move(object_args));
DispatchEvent(profile, events::TABS_ON_ACTIVATED,
tabs::OnActivated::kEventName, std::move(on_activated_args),
@@ -354,8 +348,7 @@ void TabsEventRouter::TabSelectionChanged(
select_info->Set(
tabs_constants::kWindowIdKey,
- new FundamentalValue(
- ExtensionTabUtil::GetWindowIdOfTabStripModel(tab_strip_model)));
+ new Value(ExtensionTabUtil::GetWindowIdOfTabStripModel(tab_strip_model)));
select_info->Set(tabs_constants::kTabIdsKey, all_tabs.release());
args->Append(std::move(select_info));
@@ -380,12 +373,9 @@ void TabsEventRouter::TabMoved(WebContents* contents,
std::unique_ptr<base::DictionaryValue> object_args(
new base::DictionaryValue());
object_args->Set(tabs_constants::kWindowIdKey,
- new FundamentalValue(
- ExtensionTabUtil::GetWindowIdOfTab(contents)));
- object_args->Set(tabs_constants::kFromIndexKey,
- new FundamentalValue(from_index));
- object_args->Set(tabs_constants::kToIndexKey,
- new FundamentalValue(to_index));
+ new Value(ExtensionTabUtil::GetWindowIdOfTab(contents)));
+ object_args->Set(tabs_constants::kFromIndexKey, new Value(from_index));
+ object_args->Set(tabs_constants::kToIndexKey, new Value(to_index));
args->Append(std::move(object_args));
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());

Powered by Google App Engine
This is Rietveld 408576698