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

Side by Side Diff: chrome/browser/download/notification/download_item_notification.h

Issue 1389273004: Update first download notification correctly if there are multiple notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the download manually in the test Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_item_notification.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_
6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_
7 7
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/browser/download/download_commands.h" 9 #include "chrome/browser/download/download_commands.h"
10 #include "chrome/browser/download/notification/download_notification.h" 10 #include "chrome/browser/download/notification/download_notification.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 Browser* GetBrowser() const; 99 Browser* GetBrowser() const;
100 Profile* profile() const; 100 Profile* profile() const;
101 101
102 // Returns the list of possible extra (all except the default) actions. 102 // Returns the list of possible extra (all except the default) actions.
103 scoped_ptr<std::vector<DownloadCommands::Command>> GetExtraActions() const; 103 scoped_ptr<std::vector<DownloadCommands::Command>> GetExtraActions() const;
104 104
105 // Flag to show the notification on next update. If true, the notification 105 // Flag to show the notification on next update. If true, the notification
106 // goes visible. The initial value is true so it gets shown on initial update. 106 // goes visible. The initial value is true so it gets shown on initial update.
107 bool show_next_ = true; 107 bool show_next_ = true;
108 // Current vilibility status of the notification.
109 bool visible_ = false;
110 108
111 int image_resource_id_ = 0; 109 int image_resource_id_ = 0;
112 std::pair<gfx::VectorIconId, SkColor> vector_icon_params_; 110 std::pair<gfx::VectorIconId, SkColor> vector_icon_params_;
113 content::DownloadItem::DownloadState previous_download_state_ = 111 content::DownloadItem::DownloadState previous_download_state_ =
114 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state 112 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state
115 bool previous_dangerous_state_ = false; 113 bool previous_dangerous_state_ = false;
116 scoped_ptr<Notification> notification_; 114 scoped_ptr<Notification> notification_;
117 content::DownloadItem* item_; 115 content::DownloadItem* item_;
118 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; 116 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_;
119 117
120 // Status of the preview image decode. 118 // Status of the preview image decode.
121 ImageDecodeStatus image_decode_status_ = NOT_STARTED; 119 ImageDecodeStatus image_decode_status_ = NOT_STARTED;
122 120
121 // Pointer to the message center instance.
122 message_center::MessageCenter* message_center_;
123
124 void SetMessageCenterForTest(
125 message_center::MessageCenter* message_center);
126
123 base::WeakPtrFactory<DownloadItemNotification> weak_factory_; 127 base::WeakPtrFactory<DownloadItemNotification> weak_factory_;
124 128
125 DISALLOW_COPY_AND_ASSIGN(DownloadItemNotification); 129 DISALLOW_COPY_AND_ASSIGN(DownloadItemNotification);
126 }; 130 };
127 131
128 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ 132 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_item_notification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698