| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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( | 89 bool DownloadShelfContextMenu::GetAcceleratorForCommandId( |
| 90 int command_id, | 90 int command_id, |
| 91 ui::Accelerator* accelerator) { | 91 ui::Accelerator* accelerator) const { |
| 92 return false; | 92 return false; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const { | 95 bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const { |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 | 98 |
| 99 base::string16 DownloadShelfContextMenu::GetLabelForCommandId( | 99 base::string16 DownloadShelfContextMenu::GetLabelForCommandId( |
| 100 int command_id) const { | 100 int command_id) const { |
| 101 int id = -1; | 101 int id = -1; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 if (malicious_download_menu_model_) | 296 if (malicious_download_menu_model_) |
| 297 return malicious_download_menu_model_.get(); | 297 return malicious_download_menu_model_.get(); |
| 298 | 298 |
| 299 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); | 299 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); |
| 300 malicious_download_menu_model_->AddItem( | 300 malicious_download_menu_model_->AddItem( |
| 301 DownloadCommands::LEARN_MORE_SCANNING, | 301 DownloadCommands::LEARN_MORE_SCANNING, |
| 302 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING)); | 302 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING)); |
| 303 | 303 |
| 304 return malicious_download_menu_model_.get(); | 304 return malicious_download_menu_model_.get(); |
| 305 } | 305 } |
| OLD | NEW |