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 @@ -340,10 +340,17 @@ ExtensionFunction::ResponseAction HistoryAddUrlFunction::Run() {
340
340
if (!ValidateUrl (params->details .url , &url, &error))
341
341
return RespondNow (Error (error));
342
342
343
+ base::string16 title;
344
+ if (params->details .title .get ())
345
+ title = base::UTF8ToUTF16 (*params->details .title );
346
+
343
347
history::HistoryService* hs = HistoryServiceFactory::GetForProfile (
344
348
GetProfile (), ServiceAccessType::EXPLICIT_ACCESS);
345
349
hs->AddPage (url, base::Time::Now (), history::SOURCE_EXTENSION);
346
350
351
+ if (!title.empty ())
352
+ hs->SetPageTitle (url, title);
353
+
347
354
return RespondNow (NoArguments ());
348
355
}
349
356
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