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 @@ -340,10 +340,17 @@ ExtensionFunction::ResponseAction HistoryAddUrlFunction::Run() {
340340 if (!ValidateUrl (params->details .url , &url, &error))
341341 return RespondNow (Error (error));
342342
343+ base::string16 title;
344+ if (params->details .title .get ())
345+ title = base::UTF8ToUTF16 (*params->details .title );
346+
343347 history::HistoryService* hs = HistoryServiceFactory::GetForProfile (
344348 GetProfile (), ServiceAccessType::EXPLICIT_ACCESS);
345349 hs->AddPage (url, base::Time::Now (), history::SOURCE_EXTENSION);
346350
351+ if (!title.empty ())
352+ hs->SetPageTitle (url, title);
353+
347354 return RespondNow (NoArguments ());
348355}
349356
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