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

Side by Side Diff: chrome/common/extensions/api/downloads.idl

Issue 10836003: chrome.downloads.open() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r171777 Created 8 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/extensions/api/downloads/downloads_api_unittest.cc ('k') | no next file » | 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) 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 [permissions=downloads] 5 [permissions=downloads]
6 namespace downloads { 6 namespace downloads {
7 [inline_doc] dictionary HeaderNameValuePair { 7 [inline_doc] dictionary HeaderNameValuePair {
8 // Name of the HTTP header. 8 // Name of the HTTP header.
9 DOMString name; 9 DOMString name;
10 10
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // including state of the download, platform, registered file types and 351 // including state of the download, platform, registered file types and
352 // visual theme. If a file icon cannot be determined, 352 // visual theme. If a file icon cannot be determined,
353 // $ref:runtime.lastError 353 // $ref:runtime.lastError
354 // will contain an error message. 354 // will contain an error message.
355 // |downloadId|: The identifier for the download. 355 // |downloadId|: The identifier for the download.
356 // |callback|: A URL to an image that represents the download. 356 // |callback|: A URL to an image that represents the download.
357 static void getFileIcon(long downloadId, 357 static void getFileIcon(long downloadId,
358 optional GetFileIconOptions options, 358 optional GetFileIconOptions options,
359 GetFileIconCallback callback); 359 GetFileIconCallback callback);
360 360
361 // Erase matching $ref:DownloadItem from 361 // Open the downloaded file now if the $ref:DownloadItem is complete;
362 // history 362 // returns an error through $ref:runtime.lastError otherwise. An
363 // $ref:onChanged event will fire when the item is opened for the first
364 // time.
365 // |downloadId|: The identifier for the downloaded file.
366 static void open(long downloadId);
367
368 // Erase matching $ref:DownloadItem from history
363 [nodoc] static void erase(DownloadQuery query, 369 [nodoc] static void erase(DownloadQuery query,
364 optional EraseCallback callback); 370 optional EraseCallback callback);
365 371
366 // TODO(benjhayden) Comment. 372 // TODO(benjhayden) Comment.
367 [nodoc] static void setDestination(long downloadId, DOMString relativePath); 373 [nodoc] static void setDestination(long downloadId, DOMString relativePath);
368 374
369 // Prompt the user to either accept or cancel a dangerous download. 375 // Prompt the user to either accept or cancel a dangerous download.
370 // <code>acceptDanger()</code> does not automatically accept dangerous 376 // <code>acceptDanger()</code> does not automatically accept dangerous
371 // downloads. 377 // downloads.
372 [nodoc] static void acceptDanger(long downloadId); 378 [nodoc] static void acceptDanger(long downloadId);
373 379
374 // Show the downloaded file in its folder in a file manager. 380 // Show the downloaded file in its folder in a file manager.
375 [nodoc] static void show(long downloadId); 381 [nodoc] static void show(long downloadId);
376 382
377 // Open the downloaded file.
378 [nodoc] static void open(long downloadId);
379
380 // Initiate dragging the file to another application. 383 // Initiate dragging the file to another application.
381 [nodoc] static void drag(long downloadId); 384 [nodoc] static void drag(long downloadId);
382 }; 385 };
383 386
384 interface Events { 387 interface Events {
385 // This event fires with the $ref:DownloadItem 388 // This event fires with the $ref:DownloadItem
386 // object when a download begins. 389 // object when a download begins.
387 static void onCreated(DownloadItem downloadItem); 390 static void onCreated(DownloadItem downloadItem);
388 391
389 // Fires with the <code>downloadId</code> when a download is erased from 392 // Fires with the <code>downloadId</code> when a download is erased from
390 // history. 393 // history.
391 // |downloadId|: The <code>id</code> of the $ref:DownloadItem that was erase d. 394 // |downloadId|: The <code>id</code> of the $ref:DownloadItem that was erase d.
392 static void onErased(long downloadId); 395 static void onErased(long downloadId);
393 396
394 // When any of a $ref:DownloadItem's properties 397 // When any of a $ref:DownloadItem's properties
395 // except <code>bytesReceived</code> changes, this event fires with the 398 // except <code>bytesReceived</code> changes, this event fires with the
396 // <code>downloadId</code> and an object containing the properties that chan ged. 399 // <code>downloadId</code> and an object containing the properties that chan ged.
397 static void onChanged(DownloadDelta downloadDelta); 400 static void onChanged(DownloadDelta downloadDelta);
398 }; 401 };
399 }; 402 };
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698