Commit 532819bd authored by John Lee's avatar John Lee Committed by Commit Bot

WebUI Tab Strip: Update handler to use newer base::ListValue APIs

Change-Id: If7dcc1d250162ac5bd315d163b4f49fc0aa16b61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016352Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734706}
parent bc68a32a
......@@ -578,10 +578,8 @@ void TabStripUIHandler::HandleShowBackgroundContextMenu(
const base::ListValue* args) {
gfx::PointF point;
{
double x = 0;
args->GetDouble(0, &x);
double y = 0;
args->GetDouble(1, &y);
double x = args->GetList()[0].GetDouble();
double y = args->GetList()[1].GetDouble();
point = gfx::PointF(x, y);
}
......@@ -593,15 +591,12 @@ void TabStripUIHandler::HandleShowBackgroundContextMenu(
}
void TabStripUIHandler::HandleShowTabContextMenu(const base::ListValue* args) {
int tab_id = 0;
args->GetInteger(0, &tab_id);
int tab_id = args->GetList()[0].GetInt();
gfx::PointF point;
{
double x = 0;
args->GetDouble(1, &x);
double y = 0;
args->GetDouble(2, &y);
double x = args->GetList()[1].GetDouble();
double y = args->GetList()[2].GetDouble();
point = gfx::PointF(x, y);
}
......@@ -631,10 +626,7 @@ void TabStripUIHandler::HandleGetLayout(const base::ListValue* args) {
void TabStripUIHandler::HandleSetThumbnailTracked(const base::ListValue* args) {
AllowJavascript();
int tab_id = 0;
if (!args->GetInteger(0, &tab_id))
return;
int tab_id = args->GetList()[0].GetInt();
const bool thumbnail_tracked = args->GetList()[1].GetBool();
content::WebContents* tab = nullptr;
......@@ -653,28 +645,23 @@ void TabStripUIHandler::HandleSetThumbnailTracked(const base::ListValue* args) {
void TabStripUIHandler::HandleReportTabActivationDuration(
const base::ListValue* args) {
int duration_ms = 0;
args->GetInteger(0, &duration_ms);
int duration_ms = args->GetList()[0].GetInt();
UMA_HISTOGRAM_TIMES("WebUITabStrip.TabActivation",
base::TimeDelta::FromMilliseconds(duration_ms));
}
void TabStripUIHandler::HandleReportTabDataReceivedDuration(
const base::ListValue* args) {
int tab_count = 0;
args->GetInteger(0, &tab_count);
int duration_ms = 0;
args->GetInteger(1, &duration_ms);
int tab_count = args->GetList()[0].GetInt();
int duration_ms = args->GetList()[1].GetInt();
ReportTabDurationHistogram("TabDataReceived", tab_count,
base::TimeDelta::FromMilliseconds(duration_ms));
}
void TabStripUIHandler::HandleReportTabCreationDuration(
const base::ListValue* args) {
int tab_count = 0;
args->GetInteger(0, &tab_count);
int duration_ms = 0;
args->GetInteger(1, &duration_ms);
int tab_count = args->GetList()[0].GetInt();
int duration_ms = args->GetList()[1].GetInt();
ReportTabDurationHistogram("TabCreation", tab_count,
base::TimeDelta::FromMilliseconds(duration_ms));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment