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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whoops Created 6 years, 1 month 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
OLDNEW
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/extensions/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 download_danger_type_enum_changed); 182 download_danger_type_enum_changed);
183 183
184 // Note: Any change to the state strings, should be accompanied by a 184 // Note: Any change to the state strings, should be accompanied by a
185 // corresponding change to downloads.json. 185 // corresponding change to downloads.json.
186 const char* const kStateStrings[] = { 186 const char* const kStateStrings[] = {
187 kStateInProgress, 187 kStateInProgress,
188 kStateComplete, 188 kStateComplete,
189 kStateInterrupted, 189 kStateInterrupted,
190 kStateInterrupted, 190 kStateInterrupted,
191 }; 191 };
192 COMPILE_ASSERT(arraysize(kStateStrings) == DownloadItem::MAX_DOWNLOAD_STATE, 192 COMPILE_ASSERT(arraysize(kStateStrings) == DownloadItem::MAX_DOWNLOAD_STATE - 1,
Dan Beam 2014/11/13 02:51:16 i couldn't find this file and wasn't sure what to
193 download_item_state_enum_changed); 193 download_item_state_enum_changed);
194 194
195 const char* DangerString(content::DownloadDangerType danger) { 195 const char* DangerString(content::DownloadDangerType danger) {
196 DCHECK(danger >= 0); 196 DCHECK(danger >= 0);
197 DCHECK(danger < static_cast<content::DownloadDangerType>( 197 DCHECK(danger < static_cast<content::DownloadDangerType>(
198 arraysize(kDangerStrings))); 198 arraysize(kDangerStrings)));
199 if (danger < 0 || danger >= static_cast<content::DownloadDangerType>( 199 if (danger < 0 || danger >= static_cast<content::DownloadDangerType>(
200 arraysize(kDangerStrings))) 200 arraysize(kDangerStrings)))
201 return ""; 201 return "";
202 return kDangerStrings[danger]; 202 return kDangerStrings[danger];
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 const Extension* extension, 1932 const Extension* extension,
1933 UnloadedExtensionInfo::Reason reason) { 1933 UnloadedExtensionInfo::Reason reason) {
1934 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1934 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1935 std::set<const Extension*>::iterator iter = 1935 std::set<const Extension*>::iterator iter =
1936 shelf_disabling_extensions_.find(extension); 1936 shelf_disabling_extensions_.find(extension);
1937 if (iter != shelf_disabling_extensions_.end()) 1937 if (iter != shelf_disabling_extensions_.end())
1938 shelf_disabling_extensions_.erase(iter); 1938 shelf_disabling_extensions_.erase(iter);
1939 } 1939 }
1940 1940
1941 } // namespace extensions 1941 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698