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 "chrome/browser/download/download_shelf_context_menu.h" | 5 #include "chrome/browser/download/download_shelf_context_menu.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/download/download_item_model.h" | 8 #include "chrome/browser/download/download_item_model.h" |
9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
10 #include "content/public/common/content_features.h" | 10 #include "content/public/common/content_features.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void DownloadShelfContextMenu::ExecuteCommand(int command_id, int event_flags) { | 81 void DownloadShelfContextMenu::ExecuteCommand(int command_id, int event_flags) { |
82 if (!download_commands_) | 82 if (!download_commands_) |
83 return; | 83 return; |
84 | 84 |
85 download_commands_->ExecuteCommand( | 85 download_commands_->ExecuteCommand( |
86 static_cast<DownloadCommands::Command>(command_id)); | 86 static_cast<DownloadCommands::Command>(command_id)); |
87 } | 87 } |
88 | 88 |
89 bool DownloadShelfContextMenu::GetAcceleratorForCommandId( | |
90 int command_id, | |
91 ui::Accelerator* accelerator) const { | |
92 return false; | |
93 } | |
94 | |
95 bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const { | 89 bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const { |
96 return false; | 90 return false; |
97 } | 91 } |
98 | 92 |
99 base::string16 DownloadShelfContextMenu::GetLabelForCommandId( | 93 base::string16 DownloadShelfContextMenu::GetLabelForCommandId( |
100 int command_id) const { | 94 int command_id) const { |
101 int id = -1; | 95 int id = -1; |
102 | 96 |
103 switch (static_cast<DownloadCommands::Command>(command_id)) { | 97 switch (static_cast<DownloadCommands::Command>(command_id)) { |
104 case DownloadCommands::OPEN_WHEN_COMPLETE: | 98 case DownloadCommands::OPEN_WHEN_COMPLETE: |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (malicious_download_menu_model_) | 290 if (malicious_download_menu_model_) |
297 return malicious_download_menu_model_.get(); | 291 return malicious_download_menu_model_.get(); |
298 | 292 |
299 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); | 293 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); |
300 malicious_download_menu_model_->AddItem( | 294 malicious_download_menu_model_->AddItem( |
301 DownloadCommands::LEARN_MORE_SCANNING, | 295 DownloadCommands::LEARN_MORE_SCANNING, |
302 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING)); | 296 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING)); |
303 | 297 |
304 return malicious_download_menu_model_.get(); | 298 return malicious_download_menu_model_.get(); |
305 } | 299 } |
OLD | NEW |