| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/dom_ui/history_ui.h" |
| 10 #include "chrome/browser/metrics/user_metrics.h" | 11 #include "chrome/browser/metrics/user_metrics.h" |
| 11 #include "chrome/browser/tab_contents/navigation_controller.h" | 12 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 12 #include "chrome/browser/tab_contents/navigation_entry.h" | 13 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 13 #include "chrome/common/l10n_util.h" | 14 #include "chrome/common/l10n_util.h" |
| 14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 15 #include "net/base/registry_controlled_domain.h" | 16 #include "net/base/registry_controlled_domain.h" |
| 16 | 17 |
| 17 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 18 // TODO(port): port these headers and remove the platform defines. | 19 // TODO(port): port these headers and remove the platform defines. |
| 19 #include "chrome/browser/history_tab_ui.h" | 20 #include "chrome/browser/history_tab_ui.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 TabContents* contents = GetTabContents(); | 164 TabContents* contents = GetTabContents(); |
| 164 NavigationController* controller = contents->controller(); | 165 NavigationController* controller = contents->controller(); |
| 165 | 166 |
| 166 DCHECK(!IsSeparator(menu_id)); | 167 DCHECK(!IsSeparator(menu_id)); |
| 167 | 168 |
| 168 // Execute the command for the last item: "Show Full History". | 169 // Execute the command for the last item: "Show Full History". |
| 169 if (menu_id == GetTotalItemCount()) { | 170 if (menu_id == GetTotalItemCount()) { |
| 170 UserMetrics::RecordComputedAction(BuildActionName(L"ShowFullHistory", -1), | 171 UserMetrics::RecordComputedAction(BuildActionName(L"ShowFullHistory", -1), |
| 171 controller->profile()); | 172 controller->profile()); |
| 172 #if defined(OS_WIN) | 173 #if defined(OS_WIN) |
| 173 browser_->ShowNativeUITab(HistoryTabUI::GetURL()); | 174 browser_->ShowSingleDOMUITab(HistoryUI::GetBaseURL()); |
| 174 #else | 175 #else |
| 175 NOTIMPLEMENTED(); | 176 NOTIMPLEMENTED(); |
| 176 #endif | 177 #endif |
| 177 return; | 178 return; |
| 178 } | 179 } |
| 179 | 180 |
| 180 // Log whether it was a history or chapter click. | 181 // Log whether it was a history or chapter click. |
| 181 if (menu_id <= GetHistoryItemCount()) { | 182 if (menu_id <= GetHistoryItemCount()) { |
| 182 UserMetrics::RecordComputedAction( | 183 UserMetrics::RecordComputedAction( |
| 183 BuildActionName(L"HistoryClick", menu_id), controller->profile()); | 184 BuildActionName(L"HistoryClick", menu_id), controller->profile()); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 std::wstring metric_string; | 301 std::wstring metric_string; |
| 301 if (model_type_ == FORWARD_MENU_DELEGATE) | 302 if (model_type_ == FORWARD_MENU_DELEGATE) |
| 302 metric_string += L"ForwardMenu_"; | 303 metric_string += L"ForwardMenu_"; |
| 303 else | 304 else |
| 304 metric_string += L"BackMenu_"; | 305 metric_string += L"BackMenu_"; |
| 305 metric_string += action; | 306 metric_string += action; |
| 306 if (index != -1) | 307 if (index != -1) |
| 307 metric_string += IntToWString(index); | 308 metric_string += IntToWString(index); |
| 308 return metric_string; | 309 return metric_string; |
| 309 } | 310 } |
| OLD | NEW |