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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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 | « ash/rotator/screen_rotation_animator.cc ('k') | ash/shelf/shelf_view_unittest.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 (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 "ash/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 } else if (event.IsGestureEvent()) { 1761 } else if (event.IsGestureEvent()) {
1762 Shell::GetInstance()->metrics()->RecordUserMetricsAction( 1762 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
1763 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH); 1763 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH);
1764 } 1764 }
1765 } 1765 }
1766 1766
1767 void ShelfView::RecordIconActivatedAction( 1767 void ShelfView::RecordIconActivatedAction(
1768 ShelfItemDelegate::PerformedAction performed_action) { 1768 ShelfItemDelegate::PerformedAction performed_action) {
1769 switch (performed_action) { 1769 switch (performed_action) {
1770 case ShelfItemDelegate::kNoAction: 1770 case ShelfItemDelegate::kNoAction:
1771 case ShelfItemDelegate::kExistingWindowMinimized:
1772 case ShelfItemDelegate::kAppListMenuShown: 1771 case ShelfItemDelegate::kAppListMenuShown:
1773 break; 1772 break;
1774 case ShelfItemDelegate::kNewWindowCreated: 1773 case ShelfItemDelegate::kNewWindowCreated:
1775 Shell::GetInstance()->metrics()->RecordUserMetricsAction( 1774 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
1776 UMA_LAUNCHER_LAUNCH_TASK); 1775 UMA_LAUNCHER_LAUNCH_TASK);
1777 break; 1776 break;
1778 case ShelfItemDelegate::kExistingWindowActivated: 1777 case ShelfItemDelegate::kExistingWindowActivated:
1779 Shell::GetInstance()->metrics()->RecordUserMetricsAction( 1778 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
1780 UMA_LAUNCHER_SWITCH_TASK); 1779 UMA_LAUNCHER_SWITCH_TASK);
1781 break; 1780 break;
1781 case ShelfItemDelegate::kExistingWindowMinimized:
1782 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
1783 UMA_LAUNCHER_MINIMIZE_TASK);
1784 break;
1782 } 1785 }
1783 } 1786 }
1784 1787
1785 bool ShelfView::ShowListMenuForView(const ShelfItem& item, 1788 bool ShelfView::ShowListMenuForView(const ShelfItem& item,
1786 views::View* source, 1789 views::View* source,
1787 const ui::Event& event) { 1790 const ui::Event& event) {
1788 ShelfItemDelegate* item_delegate = 1791 ShelfItemDelegate* item_delegate =
1789 item_manager_->GetShelfItemDelegate(item.id); 1792 item_manager_->GetShelfItemDelegate(item.id);
1790 scoped_ptr<ui::MenuModel> list_menu_model( 1793 scoped_ptr<ui::MenuModel> list_menu_model(
1791 item_delegate->CreateApplicationMenu(event.flags())); 1794 item_delegate->CreateApplicationMenu(event.flags()));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 distance = bounds.x() - coordinate.x(); 1994 distance = bounds.x() - coordinate.x();
1992 break; 1995 break;
1993 case SHELF_ALIGNMENT_TOP: 1996 case SHELF_ALIGNMENT_TOP:
1994 distance = coordinate.y() - bounds.bottom(); 1997 distance = coordinate.y() - bounds.bottom();
1995 break; 1998 break;
1996 } 1999 }
1997 return distance > 0 ? distance : 0; 2000 return distance > 0 ? distance : 0;
1998 } 2001 }
1999 2002
2000 } // namespace ash 2003 } // namespace ash
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animator.cc ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698