OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/web_applications/web_app_win.h" | 5 #include "chrome/browser/web_applications/web_app_win.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 | 442 |
443 bool CreatePlatformShortcuts( | 443 bool CreatePlatformShortcuts( |
444 const base::FilePath& web_app_path, | 444 const base::FilePath& web_app_path, |
445 const ShortcutInfo& shortcut_info, | 445 const ShortcutInfo& shortcut_info, |
446 const extensions::FileHandlersInfo& file_handlers_info, | 446 const extensions::FileHandlersInfo& file_handlers_info, |
447 const ShortcutLocations& creation_locations, | 447 const ShortcutLocations& creation_locations, |
448 ShortcutCreationReason creation_reason) { | 448 ShortcutCreationReason creation_reason) { |
449 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 449 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
450 | 450 |
| 451 // Nothing to do on Windows for hidden apps. |
| 452 if (creation_locations.applications_menu_location == APP_MENU_LOCATION_HIDDEN) |
| 453 return true; |
| 454 |
451 // Shortcut paths under which to create shortcuts. | 455 // Shortcut paths under which to create shortcuts. |
452 std::vector<base::FilePath> shortcut_paths = | 456 std::vector<base::FilePath> shortcut_paths = |
453 GetShortcutPaths(creation_locations); | 457 GetShortcutPaths(creation_locations); |
454 | 458 |
455 bool pin_to_taskbar = creation_locations.in_quick_launch_bar && | 459 bool pin_to_taskbar = creation_locations.in_quick_launch_bar && |
456 (base::win::GetVersion() >= base::win::VERSION_WIN7); | 460 (base::win::GetVersion() >= base::win::VERSION_WIN7); |
457 | 461 |
458 // Create/update the shortcut in the web app path for the "Pin To Taskbar" | 462 // Create/update the shortcut in the web app path for the "Pin To Taskbar" |
459 // option in Win7. We use the web app path shortcut because we will overwrite | 463 // option in Win7. We use the web app path shortcut because we will overwrite |
460 // it rather than appending unique numbers if the shortcut already exists. | 464 // it rather than appending unique numbers if the shortcut already exists. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 619 |
616 } // namespace internals | 620 } // namespace internals |
617 | 621 |
618 void UpdateShortcutForTabContents(content::WebContents* web_contents) { | 622 void UpdateShortcutForTabContents(content::WebContents* web_contents) { |
619 // UpdateShortcutWorker will delete itself when it's done. | 623 // UpdateShortcutWorker will delete itself when it's done. |
620 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); | 624 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); |
621 worker->Run(); | 625 worker->Run(); |
622 } | 626 } |
623 | 627 |
624 } // namespace web_app | 628 } // namespace web_app |
OLD | NEW |