OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/back_forward_menu_model_win.h" | |
6 | |
7 #include "chrome/browser/browser.h" | |
8 #include "chrome/browser/metrics/user_metrics.h" | |
9 #include "grit/generated_resources.h" | |
10 | |
11 // static | |
12 BackForwardMenuModel* BackForwardMenuModel::Create(Browser* browser, | |
13 ModelType model_type) { | |
14 return new BackForwardMenuModelWin(browser, model_type); | |
15 } | |
16 | |
17 BackForwardMenuModelWin::BackForwardMenuModelWin(Browser* browser, | |
18 ModelType model_type) { | |
19 browser_ = browser; | |
20 model_type_ = model_type; | |
21 } | |
22 | |
23 std::wstring BackForwardMenuModelWin::GetLabel(int menu_id) const { | |
24 return GetItemLabel(menu_id); | |
25 } | |
26 | |
27 const SkBitmap& BackForwardMenuModelWin::GetIcon(int menu_id) const { | |
28 // Return NULL if the item doesn't have an icon | |
29 if (!ItemHasIcon(menu_id)) | |
30 return GetEmptyIcon(); | |
31 | |
32 return GetItemIcon(menu_id); | |
33 } | |
34 | |
35 bool BackForwardMenuModelWin::IsItemSeparator(int menu_id) const { | |
36 return IsSeparator(menu_id); | |
37 } | |
38 | |
39 bool BackForwardMenuModelWin::HasIcon(int menu_id) const { | |
40 return ItemHasIcon(menu_id); | |
41 } | |
42 | |
43 bool BackForwardMenuModelWin::SupportsCommand(int menu_id) const { | |
44 return ItemHasCommand(menu_id); | |
45 } | |
46 | |
47 bool BackForwardMenuModelWin::IsCommandEnabled(int menu_id) const { | |
48 return ItemHasCommand(menu_id); | |
49 } | |
50 | |
51 void BackForwardMenuModelWin::ExecuteCommand(int menu_id) { | |
52 ExecuteCommandById(menu_id); | |
53 } | |
54 | |
55 void BackForwardMenuModelWin::MenuWillShow() { | |
56 UserMetrics::RecordComputedAction(BuildActionName(L"Popup", -1), | |
57 browser_->profile()); | |
58 } | |
59 | |
60 int BackForwardMenuModelWin::GetItemCount() const { | |
61 return GetTotalItemCount(); | |
62 } | |
OLD | NEW |