File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
browser/extensions/api/history Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -351,10 +351,17 @@ bool HistoryAddUrlFunction::RunAsync() {
351351 if (!ValidateUrl (params->details .url , &url))
352352 return false ;
353353
354+ base::string16 title;
355+ if (params->details .title .get ())
356+ title = base::UTF8ToUTF16 (*params->details .title );
357+
354358 history::HistoryService* hs = HistoryServiceFactory::GetForProfile (
355359 GetProfile (), ServiceAccessType::EXPLICIT_ACCESS);
356360 hs->AddPage (url, base::Time::Now (), history::SOURCE_EXTENSION);
357361
362+ if (!title.empty ())
363+ hs->SetPageTitle (url, title);
364+
358365 SendResponse (true );
359366 return true ;
360367}
Original file line number Diff line number Diff line change 9797 "name" : " details" ,
9898 "type" : " object" ,
9999 "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." }
101102 }
102103 },
103104 {
You can’t perform that action at this time.
0 commit comments