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

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

Issue 915973002: Add bookmark apps to taskbar automatically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 <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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 Profile* current_profile = profile_->GetOriginalProfile(); 424 Profile* current_profile = profile_->GetOriginalProfile();
425 chrome::HostDesktopType desktop = browser->host_desktop_type(); 425 chrome::HostDesktopType desktop = browser->host_desktop_type();
426 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) { 426 if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) {
427 web_app::ShortcutLocations creation_locations; 427 web_app::ShortcutLocations creation_locations;
428 #if defined(OS_LINUX) 428 #if defined(OS_LINUX)
429 creation_locations.on_desktop = true; 429 creation_locations.on_desktop = true;
430 #else 430 #else
431 creation_locations.on_desktop = false; 431 creation_locations.on_desktop = false;
432 #endif 432 #endif
433 creation_locations.applications_menu_location = 433 creation_locations.applications_menu_location =
434 web_app::APP_MENU_LOCATION_HIDDEN; 434 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS;
435 creation_locations.in_quick_launch_bar = true; 435 creation_locations.in_quick_launch_bar = true;
436 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, 436 web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER,
437 creation_locations, current_profile, extension); 437 creation_locations, current_profile, extension);
438 #if defined(USE_ASH) 438 #if defined(USE_ASH)
439 } else { 439 } else {
440 ChromeLauncherController::instance()->PinAppWithID(extension->id()); 440 ChromeLauncherController::instance()->PinAppWithID(extension->id());
441 #endif 441 #endif
442 } 442 }
443 443
444 // Show the newly installed app in the app launcher, in finder (on Mac) or 444 // Show the newly installed app in the app launcher, in finder (on Mac) or
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); 537 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback));
538 } 538 }
539 539
540 bool IsValidBookmarkAppUrl(const GURL& url) { 540 bool IsValidBookmarkAppUrl(const GURL& url) {
541 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); 541 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes);
542 origin_only_pattern.SetMatchAllURLs(true); 542 origin_only_pattern.SetMatchAllURLs(true);
543 return url.is_valid() && origin_only_pattern.MatchesURL(url); 543 return url.is_valid() && origin_only_pattern.MatchesURL(url);
544 } 544 }
545 545
546 } // namespace extensions 546 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app.cc » ('j') | chrome/browser/web_applications/web_app.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698