| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/back_forward_menu_model.h" | 7 #include "chrome/browser/back_forward_menu_model.h" |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 void BackForwardMenuModel::ActivatedAtWithDisposition( | 139 void BackForwardMenuModel::ActivatedAtWithDisposition( |
| 140 int index, int disposition) { | 140 int index, int disposition) { |
| 141 Profile* profile = browser_->profile(); | 141 Profile* profile = browser_->profile(); |
| 142 | 142 |
| 143 DCHECK(!IsSeparator(index)); | 143 DCHECK(!IsSeparator(index)); |
| 144 | 144 |
| 145 // Execute the command for the last item: "Show Full History". | 145 // Execute the command for the last item: "Show Full History". |
| 146 if (index == GetItemCount() - 1) { | 146 if (index == GetItemCount() - 1) { |
| 147 UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1), | 147 UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1), |
| 148 profile); | 148 profile); |
| 149 browser_->ShowSingletonTab(GURL(chrome::kChromeUIHistoryURL)); | 149 browser_->ShowSingletonTab(GURL(chrome::kChromeUIHistoryURL), false); |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Log whether it was a history or chapter click. | 153 // Log whether it was a history or chapter click. |
| 154 if (index < GetHistoryItemCount()) { | 154 if (index < GetHistoryItemCount()) { |
| 155 UserMetrics::RecordComputedAction( | 155 UserMetrics::RecordComputedAction( |
| 156 BuildActionName("HistoryClick", index), profile); | 156 BuildActionName("HistoryClick", index), profile); |
| 157 } else { | 157 } else { |
| 158 UserMetrics::RecordComputedAction( | 158 UserMetrics::RecordComputedAction( |
| 159 BuildActionName("ChapterClick", index - GetHistoryItemCount() - 1), | 159 BuildActionName("ChapterClick", index - GetHistoryItemCount() - 1), |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 metric_string += "ForwardMenu_"; | 365 metric_string += "ForwardMenu_"; |
| 366 else | 366 else |
| 367 metric_string += "BackMenu_"; | 367 metric_string += "BackMenu_"; |
| 368 metric_string += action; | 368 metric_string += action; |
| 369 if (index != -1) { | 369 if (index != -1) { |
| 370 // +1 is for historical reasons (indices used to start at 1). | 370 // +1 is for historical reasons (indices used to start at 1). |
| 371 metric_string += base::IntToString(index + 1); | 371 metric_string += base::IntToString(index + 1); |
| 372 } | 372 } |
| 373 return metric_string; | 373 return metric_string; |
| 374 } | 374 } |
| OLD | NEW |