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

Side by Side Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 12386088: Add a shortcut to open the Apps page from the bookmark bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased and answered sky's comments. Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
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/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/bookmarks/bookmark_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 return node; 433 return node;
434 } 434 }
435 435
436 void RegisterUserPrefs(PrefRegistrySyncable* registry) { 436 void RegisterUserPrefs(PrefRegistrySyncable* registry) {
437 registry->RegisterBooleanPref(prefs::kShowBookmarkBar, 437 registry->RegisterBooleanPref(prefs::kShowBookmarkBar,
438 false, 438 false,
439 PrefRegistrySyncable::SYNCABLE_PREF); 439 PrefRegistrySyncable::SYNCABLE_PREF);
440 registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, 440 registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled,
441 true, 441 true,
442 PrefRegistrySyncable::UNSYNCABLE_PREF); 442 PrefRegistrySyncable::UNSYNCABLE_PREF);
443 registry->RegisterBooleanPref(prefs::kShowAppsShortcutInBookmarkBar,
444 true,
445 PrefRegistrySyncable::SYNCABLE_PREF);
443 } 446 }
444 447
445 const BookmarkNode* GetParentForNewNodes( 448 const BookmarkNode* GetParentForNewNodes(
446 const BookmarkNode* parent, 449 const BookmarkNode* parent,
447 const std::vector<const BookmarkNode*>& selection, 450 const std::vector<const BookmarkNode*>& selection,
448 int* index) { 451 int* index) {
449 const BookmarkNode* real_parent = parent; 452 const BookmarkNode* real_parent = parent;
450 453
451 if (selection.size() == 1 && selection[0]->is_folder()) 454 if (selection.size() == 1 && selection[0]->is_folder())
452 real_parent = selection[0]; 455 real_parent = selection[0];
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 content::RecordAction(UserMetricsAction("ClickedBookmarkBarFolder")); 516 content::RecordAction(UserMetricsAction("ClickedBookmarkBarFolder"));
514 } 517 }
515 518
516 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { 519 void RecordBookmarkLaunch(BookmarkLaunchLocation location) {
517 if (location == LAUNCH_DETACHED_BAR || location == LAUNCH_ATTACHED_BAR) 520 if (location == LAUNCH_DETACHED_BAR || location == LAUNCH_ATTACHED_BAR)
518 content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton")); 521 content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
519 522
520 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); 523 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT);
521 } 524 }
522 525
526 void RecordAppsPageOpen(BookmarkLaunchLocation location) {
527 if (location == LAUNCH_DETACHED_BAR || location == LAUNCH_ATTACHED_BAR) {
528 content::RecordAction(
529 UserMetricsAction("ClickedBookmarkBarAppsShortcutButton"));
530 }
531 }
532
523 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(USE_AURA) 533 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(USE_AURA)
524 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) { 534 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) {
525 g_bookmark_bar_view_animations_disabled = disabled; 535 g_bookmark_bar_view_animations_disabled = disabled;
526 } 536 }
527 537
528 bool IsBookmarkBarViewAnimationsDisabled() { 538 bool IsBookmarkBarViewAnimationsDisabled() {
529 return g_bookmark_bar_view_animations_disabled; 539 return g_bookmark_bar_view_animations_disabled;
530 } 540 }
531 #endif 541 #endif
532 542
533 } // namespace bookmark_utils 543 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.h ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698