+namespace {
+
+void CreateIconAndSetRelaunchDetails(
+ const base::FilePath& web_app_path,
+ const base::FilePath& icon_file,
+ const ShellIntegration::ShortcutInfo& shortcut_info,
+ const HWND hwnd) {
+ DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
+
+ // Set the relaunch data so "Pin this program to taskbar" has the app's
+ // information.
+ CommandLine command_line = ShellIntegration::CommandLineArgsForLauncher(
+ shortcut_info.url,
+ shortcut_info.extension_id,
+ shortcut_info.profile_path);
+
+ base::FilePath chrome_exe;
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
+ NOTREACHED();
+ return;
+ }
+ command_line.SetProgram(chrome_exe);
+ ui::win::SetRelaunchDetailsForWindow(command_line.GetCommandLineString(),
+ shortcut_info.title, hwnd);
+
+ if (!base::PathExists(web_app_path) &&
+ !base::CreateDirectory(web_app_path)) {
+ return;
+ }
+
+ ui::win::SetAppIconForWindow(icon_file.value(), hwnd);
+ web_app::internals::CheckAndSaveIcon(icon_file, shortcut_info.favicon);
+}
+
+} // namespace
+
+NativeAppWindowViewsWin::NativeAppWindowViewsWin()
+ : weak_ptr_factory_(this) {