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

Side by Side Diff: content/browser/download/download_item_impl.h

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement a separate callbacks flow for 'shown in shell' event to not mix with 'opened' Created 6 years, 7 months 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 virtual int64 GetTotalBytes() const OVERRIDE; 141 virtual int64 GetTotalBytes() const OVERRIDE;
142 virtual int64 GetReceivedBytes() const OVERRIDE; 142 virtual int64 GetReceivedBytes() const OVERRIDE;
143 virtual base::Time GetStartTime() const OVERRIDE; 143 virtual base::Time GetStartTime() const OVERRIDE;
144 virtual base::Time GetEndTime() const OVERRIDE; 144 virtual base::Time GetEndTime() const OVERRIDE;
145 virtual bool CanShowInFolder() OVERRIDE; 145 virtual bool CanShowInFolder() OVERRIDE;
146 virtual bool CanOpenDownload() OVERRIDE; 146 virtual bool CanOpenDownload() OVERRIDE;
147 virtual bool ShouldOpenFileBasedOnExtension() OVERRIDE; 147 virtual bool ShouldOpenFileBasedOnExtension() OVERRIDE;
148 virtual bool GetOpenWhenComplete() const OVERRIDE; 148 virtual bool GetOpenWhenComplete() const OVERRIDE;
149 virtual bool GetAutoOpened() OVERRIDE; 149 virtual bool GetAutoOpened() OVERRIDE;
150 virtual bool GetOpened() const OVERRIDE; 150 virtual bool GetOpened() const OVERRIDE;
151 virtual bool GetShownWhenComplete() const OVERRIDE;
151 virtual BrowserContext* GetBrowserContext() const OVERRIDE; 152 virtual BrowserContext* GetBrowserContext() const OVERRIDE;
152 virtual WebContents* GetWebContents() const OVERRIDE; 153 virtual WebContents* GetWebContents() const OVERRIDE;
153 virtual void OnContentCheckCompleted(DownloadDangerType danger_type) OVERRIDE; 154 virtual void OnContentCheckCompleted(DownloadDangerType danger_type) OVERRIDE;
154 virtual void SetOpenWhenComplete(bool open) OVERRIDE; 155 virtual void SetOpenWhenComplete(bool open) OVERRIDE;
155 virtual void SetIsTemporary(bool temporary) OVERRIDE; 156 virtual void SetIsTemporary(bool temporary) OVERRIDE;
156 virtual void SetOpened(bool opened) OVERRIDE; 157 virtual void SetOpened(bool opened) OVERRIDE;
158 virtual void SetShownWhenComplete(bool shown) OVERRIDE;
157 virtual void SetDisplayName(const base::FilePath& name) OVERRIDE; 159 virtual void SetDisplayName(const base::FilePath& name) OVERRIDE;
158 virtual std::string DebugString(bool verbose) const OVERRIDE; 160 virtual std::string DebugString(bool verbose) const OVERRIDE;
159 161
160 // All remaining public interfaces virtual to allow for DownloadItemImpl 162 // All remaining public interfaces virtual to allow for DownloadItemImpl
161 // mocks. 163 // mocks.
162 164
163 // Determines the resume mode for an interrupted download. Requires 165 // Determines the resume mode for an interrupted download. Requires
164 // last_reason_ to be set, but doesn't require the download to be in 166 // last_reason_ to be set, but doesn't require the download to be in
165 // INTERRUPTED state. 167 // INTERRUPTED state.
166 virtual ResumeMode GetResumeMode() const; 168 virtual ResumeMode GetResumeMode() const;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // last_reason_ so that we can avoid handling destination errors until 533 // last_reason_ so that we can avoid handling destination errors until
532 // after file name determination has occurred. 534 // after file name determination has occurred.
533 DownloadInterruptReason destination_error_; 535 DownloadInterruptReason destination_error_;
534 536
535 // Did the user open the item either directly or indirectly (such as by 537 // Did the user open the item either directly or indirectly (such as by
536 // setting always open files of this type)? The shelf also sets this field 538 // setting always open files of this type)? The shelf also sets this field
537 // when the user closes the shelf before the item has been opened but should 539 // when the user closes the shelf before the item has been opened but should
538 // be treated as though the user opened it. 540 // be treated as though the user opened it.
539 bool opened_; 541 bool opened_;
540 542
543 // Did the user show the item in shell after it was complete? The shelf uses
544 // the value from this field to determine if it can autohide itself, so it
545 // is possible to autohide when user interacted with completed download by
546 // showing the file in shell, instead of opening. The shelf also sets this
547 // field when user closes the shelf before the item has been 'shown in
548 // shell'.
549 bool shownWhenComplete_;
asanka 2014/06/05 19:26:28 Nit: unix_hacker_style_
DukeXar 2014/06/06 15:07:14 Well, I have deleted it at all.
550
541 // Did the delegate delay calling Complete on this download? 551 // Did the delegate delay calling Complete on this download?
542 bool delegate_delayed_complete_; 552 bool delegate_delayed_complete_;
543 553
544 // DownloadFile associated with this download. Note that this 554 // DownloadFile associated with this download. Note that this
545 // pointer may only be used or destroyed on the FILE thread. 555 // pointer may only be used or destroyed on the FILE thread.
546 // This pointer will be non-null only while the DownloadItem is in 556 // This pointer will be non-null only while the DownloadItem is in
547 // the IN_PROGRESS state. 557 // the IN_PROGRESS state.
548 scoped_ptr<DownloadFile> download_file_; 558 scoped_ptr<DownloadFile> download_file_;
549 559
550 // Net log to use for this download. 560 // Net log to use for this download.
551 const net::BoundNetLog bound_net_log_; 561 const net::BoundNetLog bound_net_log_;
552 562
553 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; 563 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_;
554 564
555 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); 565 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
556 }; 566 };
557 567
558 } // namespace content 568 } // namespace content
559 569
560 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 570 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698