| 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 "chrome/browser/back_forward_menu_model_views.h" | 5 #include "chrome/browser/back_forward_menu_model_views.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/metrics/user_metrics.h" | 9 #include "chrome/browser/metrics/user_metrics.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 int index) const { | 36 int index) const { |
| 37 if (IsSeparator(GetCommandIdAt(index))) | 37 if (IsSeparator(GetCommandIdAt(index))) |
| 38 return views::Menu2Model::TYPE_SEPARATOR; | 38 return views::Menu2Model::TYPE_SEPARATOR; |
| 39 return views::Menu2Model::TYPE_COMMAND; | 39 return views::Menu2Model::TYPE_COMMAND; |
| 40 } | 40 } |
| 41 | 41 |
| 42 int BackForwardMenuModelViews::GetCommandIdAt(int index) const { | 42 int BackForwardMenuModelViews::GetCommandIdAt(int index) const { |
| 43 return index + 1; | 43 return index + 1; |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::wstring BackForwardMenuModelViews::GetLabelAt(int index) const { | 46 string16 BackForwardMenuModelViews::GetLabelAt(int index) const { |
| 47 return GetItemLabel(GetCommandIdAt(index)); | 47 return GetItemLabel(GetCommandIdAt(index)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool BackForwardMenuModelViews::IsLabelDynamicAt(int index) const { | 50 bool BackForwardMenuModelViews::IsLabelDynamicAt(int index) const { |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool BackForwardMenuModelViews::GetAcceleratorAt( | 54 bool BackForwardMenuModelViews::GetAcceleratorAt( |
| 55 int index, | 55 int index, |
| 56 views::Accelerator* accelerator) const { | 56 views::Accelerator* accelerator) const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 void BackForwardMenuModelViews::ActivatedAt(int index) { | 91 void BackForwardMenuModelViews::ActivatedAt(int index) { |
| 92 ExecuteCommandById(GetCommandIdAt(index)); | 92 ExecuteCommandById(GetCommandIdAt(index)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void BackForwardMenuModelViews::MenuWillShow() { | 95 void BackForwardMenuModelViews::MenuWillShow() { |
| 96 UserMetrics::RecordComputedAction(BuildActionName(L"Popup", -1), | 96 UserMetrics::RecordComputedAction(BuildActionName(L"Popup", -1), |
| 97 browser_->profile()); | 97 browser_->profile()); |
| 98 } | 98 } |
| OLD | NEW |