OLD | NEW |
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/launcher/launcher_view.h" | 5 #include "ash/launcher/launcher_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/launcher/app_list_button.h" | 9 #include "ash/launcher/app_list_button.h" |
10 #include "ash/launcher/launcher_button.h" | 10 #include "ash/launcher/launcher_button.h" |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 return; | 1018 return; |
1019 int view_index = view_model_->GetIndexOfView(sender); | 1019 int view_index = view_model_->GetIndexOfView(sender); |
1020 // May be -1 while in the process of animating closed. | 1020 // May be -1 while in the process of animating closed. |
1021 if (view_index == -1) | 1021 if (view_index == -1) |
1022 return; | 1022 return; |
1023 | 1023 |
1024 tooltip_->Close(); | 1024 tooltip_->Close(); |
1025 switch (model_->items()[view_index].type) { | 1025 switch (model_->items()[view_index].type) { |
1026 case TYPE_TABBED: | 1026 case TYPE_TABBED: |
1027 case TYPE_APP_PANEL: | 1027 case TYPE_APP_PANEL: |
| 1028 delegate_->ItemClicked(model_->items()[view_index], event.flags()); |
| 1029 break; |
| 1030 |
1028 case TYPE_APP_SHORTCUT: | 1031 case TYPE_APP_SHORTCUT: |
1029 case TYPE_PLATFORM_APP: | 1032 case TYPE_PLATFORM_APP: |
| 1033 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| 1034 UMA_LAUNCHER_CLICK_ON_APP); |
1030 delegate_->ItemClicked(model_->items()[view_index], event.flags()); | 1035 delegate_->ItemClicked(model_->items()[view_index], event.flags()); |
1031 break; | 1036 break; |
1032 | 1037 |
1033 case TYPE_APP_LIST: | 1038 case TYPE_APP_LIST: |
| 1039 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| 1040 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON); |
1034 Shell::GetInstance()->ToggleAppList(); | 1041 Shell::GetInstance()->ToggleAppList(); |
1035 break; | 1042 break; |
1036 | 1043 |
1037 case TYPE_BROWSER_SHORTCUT: | 1044 case TYPE_BROWSER_SHORTCUT: |
| 1045 // Click on browser icon is counted in app clicks. |
| 1046 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| 1047 UMA_LAUNCHER_CLICK_ON_APP); |
| 1048 |
1038 if (event.flags() & ui::EF_CONTROL_DOWN) | 1049 if (event.flags() & ui::EF_CONTROL_DOWN) |
1039 delegate_->CreateNewWindow(); | 1050 delegate_->CreateNewWindow(); |
1040 else | 1051 else |
1041 delegate_->CreateNewTab(); | 1052 delegate_->CreateNewTab(); |
1042 break; | 1053 break; |
1043 } | 1054 } |
1044 } | 1055 } |
1045 | 1056 |
1046 void LauncherView::ShowContextMenuForView(views::View* source, | 1057 void LauncherView::ShowContextMenuForView(views::View* source, |
1047 const gfx::Point& point) { | 1058 const gfx::Point& point) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 FOR_EACH_OBSERVER(LauncherIconObserver, observers_, | 1092 FOR_EACH_OBSERVER(LauncherIconObserver, observers_, |
1082 OnLauncherIconPositionsChanged()); | 1093 OnLauncherIconPositionsChanged()); |
1083 PreferredSizeChanged(); | 1094 PreferredSizeChanged(); |
1084 } | 1095 } |
1085 | 1096 |
1086 void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { | 1097 void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { |
1087 } | 1098 } |
1088 | 1099 |
1089 } // namespace internal | 1100 } // namespace internal |
1090 } // namespace ash | 1101 } // namespace ash |
OLD | NEW |