| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // installed, so there is no need to call this again." | 428 // installed, so there is no need to call this again." |
| 429 #if !defined(OS_MACOSX) | 429 #if !defined(OS_MACOSX) |
| 430 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) { | 430 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) { |
| 431 web_app::ShortcutLocations creation_locations; | 431 web_app::ShortcutLocations creation_locations; |
| 432 #if defined(OS_LINUX) | 432 #if defined(OS_LINUX) |
| 433 creation_locations.on_desktop = true; | 433 creation_locations.on_desktop = true; |
| 434 #else | 434 #else |
| 435 creation_locations.on_desktop = false; | 435 creation_locations.on_desktop = false; |
| 436 #endif | 436 #endif |
| 437 creation_locations.applications_menu_location = | 437 creation_locations.applications_menu_location = |
| 438 web_app::APP_MENU_LOCATION_HIDDEN; | 438 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS; |
| 439 creation_locations.in_quick_launch_bar = true; | 439 creation_locations.in_quick_launch_bar = true; |
| 440 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, | 440 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, |
| 441 creation_locations, current_profile, extension); | 441 creation_locations, current_profile, extension); |
| 442 #if defined(USE_ASH) | 442 #if defined(USE_ASH) |
| 443 } else { | 443 } else { |
| 444 ChromeLauncherController::instance()->PinAppWithID(extension->id()); | 444 ChromeLauncherController::instance()->PinAppWithID(extension->id()); |
| 445 #endif | 445 #endif |
| 446 } | 446 } |
| 447 #endif | 447 #endif |
| 448 | 448 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); | 542 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); |
| 543 } | 543 } |
| 544 | 544 |
| 545 bool IsValidBookmarkAppUrl(const GURL& url) { | 545 bool IsValidBookmarkAppUrl(const GURL& url) { |
| 546 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); | 546 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); |
| 547 origin_only_pattern.SetMatchAllURLs(true); | 547 origin_only_pattern.SetMatchAllURLs(true); |
| 548 return url.is_valid() && origin_only_pattern.MatchesURL(url); | 548 return url.is_valid() && origin_only_pattern.MatchesURL(url); |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace extensions | 551 } // namespace extensions |
| OLD | NEW |