Make size optional

This commit is contained in:
Yury Solovyov 2016-11-03 21:04:56 +03:00 committed by Kevin Sawicki
parent ff3aaa55f7
commit bec671bac8
2 changed files with 14 additions and 4 deletions

View file

@ -868,8 +868,19 @@ JumpListResult App::SetJumpList(v8::Local<v8::Value> val,
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
void App::GetFileIcon(const base::FilePath& path, void App::GetFileIcon(const base::FilePath& path,
IconLoader::IconSize icon_size, mate::Arguments* args) {
const FileIconCallback& callback) { IconLoader::IconSize icon_size;
FileIconCallback callback;
if (!args->GetNext(&icon_size)) {
icon_size = IconLoader::IconSize::NORMAL;
}
if (!args->GetNext(&callback)) {
args->ThrowError();
return;
}
IconManager* icon_manager = IconManager::GetInstance(); IconManager* icon_manager = IconManager::GetInstance();
gfx::Image* icon = icon_manager->LookupIconFromFilepath(path, icon_size); gfx::Image* icon = icon_manager->LookupIconFromFilepath(path, icon_size);
if (icon) { if (icon) {

View file

@ -133,8 +133,7 @@ class App : public AtomBrowserClient::Delegate,
const net::CompletionCallback& callback); const net::CompletionCallback& callback);
#endif #endif
void GetFileIcon(const base::FilePath& path, void GetFileIcon(const base::FilePath& path,
IconLoader::IconSize icon_size, mate::Arguments* args);
const FileIconCallback& callback);
#if defined(OS_WIN) #if defined(OS_WIN)
// Get the current Jump List settings. // Get the current Jump List settings.