| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/bookmark_app_helper.h" | 5 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 callback_.Run(extension, web_app_info_); | 681 callback_.Run(extension, web_app_info_); |
| 682 return; | 682 return; |
| 683 } | 683 } |
| 684 | 684 |
| 685 // Pin the app to the relevant launcher depending on the OS. | 685 // Pin the app to the relevant launcher depending on the OS. |
| 686 Profile* current_profile = profile_->GetOriginalProfile(); | 686 Profile* current_profile = profile_->GetOriginalProfile(); |
| 687 | 687 |
| 688 // On Mac, shortcuts are automatically created for hosted apps when they are | 688 // On Mac, shortcuts are automatically created for hosted apps when they are |
| 689 // installed, so there is no need to create them again. | 689 // installed, so there is no need to create them again. |
| 690 #if !defined(OS_MACOSX) | 690 #if !defined(OS_MACOSX) |
| 691 chrome::HostDesktopType desktop = browser->host_desktop_type(); | 691 ui::HostDesktopType desktop = browser->host_desktop_type(); |
| 692 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) { | 692 if (desktop != ui::HOST_DESKTOP_TYPE_ASH) { |
| 693 web_app::ShortcutLocations creation_locations; | 693 web_app::ShortcutLocations creation_locations; |
| 694 #if defined(OS_LINUX) | 694 #if defined(OS_LINUX) |
| 695 creation_locations.on_desktop = true; | 695 creation_locations.on_desktop = true; |
| 696 #else | 696 #else |
| 697 creation_locations.on_desktop = false; | 697 creation_locations.on_desktop = false; |
| 698 #endif | 698 #endif |
| 699 creation_locations.applications_menu_location = | 699 creation_locations.applications_menu_location = |
| 700 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS; | 700 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS; |
| 701 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, | 701 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, |
| 702 creation_locations, current_profile, extension); | 702 creation_locations, current_profile, extension); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); | 790 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); |
| 791 } | 791 } |
| 792 | 792 |
| 793 bool IsValidBookmarkAppUrl(const GURL& url) { | 793 bool IsValidBookmarkAppUrl(const GURL& url) { |
| 794 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes); | 794 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes); |
| 795 origin_only_pattern.SetMatchAllURLs(true); | 795 origin_only_pattern.SetMatchAllURLs(true); |
| 796 return url.is_valid() && origin_only_pattern.MatchesURL(url); | 796 return url.is_valid() && origin_only_pattern.MatchesURL(url); |
| 797 } | 797 } |
| 798 | 798 |
| 799 } // namespace extensions | 799 } // namespace extensions |
| OLD | NEW |