File tree 2 files changed +9
-1
lines changed
browser/extensions/api/history
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -351,10 +351,17 @@ bool HistoryAddUrlFunction::RunAsync() {
351
351
if (!ValidateUrl (params->details .url , &url))
352
352
return false ;
353
353
354
+ base::string16 title;
355
+ if (params->details .title .get ())
356
+ title = base::UTF8ToUTF16 (*params->details .title );
357
+
354
358
history::HistoryService* hs = HistoryServiceFactory::GetForProfile (
355
359
GetProfile (), ServiceAccessType::EXPLICIT_ACCESS);
356
360
hs->AddPage (url, base::Time::Now (), history::SOURCE_EXTENSION);
357
361
362
+ if (!title.empty ())
363
+ hs->SetPageTitle (url, title);
364
+
358
365
SendResponse (true );
359
366
return true ;
360
367
}
Original file line number Diff line number Diff line change 97
97
"name" : " details" ,
98
98
"type" : " object" ,
99
99
"properties" : {
100
- "url" : {"type" : " string" , "description" : " The URL to add." }
100
+ "url" : {"type" : " string" , "description" : " The URL to add." },
101
+ "title" : {"type" : " string" , "optional" : true , "description" : " The title of URL to add." }
101
102
}
102
103
},
103
104
{
You can’t perform that action at this time.
0 commit comments