Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/extensions/bookmark_app_helper.cc

Issue 1697263002: Remove HostDesktopType from some extensions files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-28
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 #include <string> 10 #include <string>
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 callback_.Run(extension, web_app_info_); 695 callback_.Run(extension, web_app_info_);
696 return; 696 return;
697 } 697 }
698 698
699 // Pin the app to the relevant launcher depending on the OS. 699 // Pin the app to the relevant launcher depending on the OS.
700 Profile* current_profile = profile_->GetOriginalProfile(); 700 Profile* current_profile = profile_->GetOriginalProfile();
701 701
702 // On Mac, shortcuts are automatically created for hosted apps when they are 702 // On Mac, shortcuts are automatically created for hosted apps when they are
703 // installed, so there is no need to create them again. 703 // installed, so there is no need to create them again.
704 #if !defined(OS_MACOSX) 704 #if !defined(OS_MACOSX)
705 chrome::HostDesktopType desktop = browser->host_desktop_type(); 705 #if !defined(USE_ASH)
706 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) { 706 web_app::ShortcutLocations creation_locations;
707 web_app::ShortcutLocations creation_locations;
708 #if defined(OS_LINUX) || defined(OS_WIN) 707 #if defined(OS_LINUX) || defined(OS_WIN)
709 creation_locations.on_desktop = true; 708 creation_locations.on_desktop = true;
710 #else 709 #else
711 creation_locations.on_desktop = false; 710 creation_locations.on_desktop = false;
712 #endif 711 #endif
713 creation_locations.applications_menu_location = 712 creation_locations.applications_menu_location =
714 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS; 713 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS;
715 creation_locations.in_quick_launch_bar = false; 714 creation_locations.in_quick_launch_bar = false;
716 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, 715 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER,
717 creation_locations, current_profile, extension); 716 creation_locations, current_profile, extension);
718 #if defined(USE_ASH) 717 #else
719 } else { 718 ChromeLauncherController::instance()->PinAppWithID(extension->id());
720 ChromeLauncherController::instance()->PinAppWithID(extension->id()); 719 #endif // USE_ASH
benwells 2016/02/16 03:45:50 nit: be consistent with the next line (!defined(OS
scottmg 2016/02/19 21:51:36 Done.
721 #endif
722 }
723 #endif // !defined(OS_MACOSX) 720 #endif // !defined(OS_MACOSX)
724 721
725 #if defined(OS_MACOSX) 722 #if defined(OS_MACOSX)
726 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 723 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
727 switches::kDisableHostedAppShimCreation)) { 724 switches::kDisableHostedAppShimCreation)) {
728 web_app::RevealAppShimInFinderForApp(current_profile, extension); 725 web_app::RevealAppShimInFinderForApp(current_profile, extension);
729 } 726 }
730 #endif 727 #endif
731 728
732 callback_.Run(extension, web_app_info_); 729 callback_.Run(extension, web_app_info_);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); 794 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback));
798 } 795 }
799 796
800 bool IsValidBookmarkAppUrl(const GURL& url) { 797 bool IsValidBookmarkAppUrl(const GURL& url) {
801 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes); 798 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes);
802 origin_only_pattern.SetMatchAllURLs(true); 799 origin_only_pattern.SetMatchAllURLs(true);
803 return url.is_valid() && origin_only_pattern.MatchesURL(url); 800 return url.is_valid() && origin_only_pattern.MatchesURL(url);
804 } 801 }
805 802
806 } // namespace extensions 803 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698