Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: chrome/browser/download/download_shelf.cc

Issue 5741001: Even more virtual method deinlining. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (windows) Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/download_shelf.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/download/download_shelf.h" 5 #include "chrome/browser/download/download_shelf.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "chrome/browser/dom_ui/downloads_ui.h" 9 #include "chrome/browser/dom_ui/downloads_ui.h"
10 #include "chrome/browser/download/download_item.h" 10 #include "chrome/browser/download/download_item.h"
11 #include "chrome/browser/download/download_item_model.h" 11 #include "chrome/browser/download/download_item_model.h"
12 #include "chrome/browser/download/download_manager.h" 12 #include "chrome/browser/download/download_manager.h"
13 #include "chrome/browser/download/download_util.h" 13 #include "chrome/browser/download/download_util.h"
14 #include "chrome/browser/metrics/user_metrics.h" 14 #include "chrome/browser/metrics/user_metrics.h"
15 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
17 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
18 18
19 // DownloadShelfContextMenu ---------------------------------------------------- 19 // DownloadShelfContextMenu ----------------------------------------------------
20 20
21 DownloadShelfContextMenu::DownloadShelfContextMenu( 21 DownloadShelfContextMenu::DownloadShelfContextMenu(
22 BaseDownloadItemModel* download_model) 22 BaseDownloadItemModel* download_model)
23 : download_(download_model->download()), 23 : download_(download_model->download()),
24 model_(download_model) { 24 model_(download_model) {
25 } 25 }
26 26
27 DownloadShelfContextMenu::~DownloadShelfContextMenu() { 27 DownloadShelfContextMenu::~DownloadShelfContextMenu() {
28 } 28 }
29 29
30 DownloadItem* DownloadShelfContextMenu::download() const {
31 return download_;
32 }
33
30 bool DownloadShelfContextMenu::IsCommandIdChecked(int command_id) const { 34 bool DownloadShelfContextMenu::IsCommandIdChecked(int command_id) const {
31 switch (command_id) { 35 switch (command_id) {
32 case OPEN_WHEN_COMPLETE: 36 case OPEN_WHEN_COMPLETE:
33 return download_->open_when_complete(); 37 return download_->open_when_complete();
34 case ALWAYS_OPEN_TYPE: 38 case ALWAYS_OPEN_TYPE:
35 return download_->ShouldOpenFileBasedOnExtension(); 39 return download_->ShouldOpenFileBasedOnExtension();
36 } 40 }
37 return false; 41 return false;
38 } 42 }
39 43
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 ALWAYS_OPEN_TYPE, IDS_DOWNLOAD_MENU_ALWAYS_OPEN_TYPE); 153 ALWAYS_OPEN_TYPE, IDS_DOWNLOAD_MENU_ALWAYS_OPEN_TYPE);
150 finished_download_menu_model_->AddSeparator(); 154 finished_download_menu_model_->AddSeparator();
151 finished_download_menu_model_->AddItemWithStringId( 155 finished_download_menu_model_->AddItemWithStringId(
152 SHOW_IN_FOLDER, IDS_DOWNLOAD_MENU_SHOW); 156 SHOW_IN_FOLDER, IDS_DOWNLOAD_MENU_SHOW);
153 finished_download_menu_model_->AddSeparator(); 157 finished_download_menu_model_->AddSeparator();
154 finished_download_menu_model_->AddItemWithStringId( 158 finished_download_menu_model_->AddItemWithStringId(
155 CANCEL, IDS_DOWNLOAD_MENU_CANCEL); 159 CANCEL, IDS_DOWNLOAD_MENU_CANCEL);
156 160
157 return finished_download_menu_model_.get(); 161 return finished_download_menu_model_.get();
158 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698