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

Side by Side Diff: components/offline_pages/downloads/download_ui_adapter.cc

Issue 2295593002: [Offline Pages] Check for the appropriate namespace when showing notifications. (Closed)
Patch Set: Add comment. Created 4 years, 3 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 | « components/offline_pages/downloads/download_ui_adapter.h ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/offline_pages/downloads/download_ui_adapter.h" 5 #include "components/offline_pages/downloads/download_ui_adapter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 for (auto& guid : added_guids) { 203 for (auto& guid : added_guids) {
204 const DownloadUIItem& item = *(items_.find(guid)->second->ui_item.get()); 204 const DownloadUIItem& item = *(items_.find(guid)->second->ui_item.get());
205 FOR_EACH_OBSERVER(Observer, observers_, ItemAdded(item)); 205 FOR_EACH_OBSERVER(Observer, observers_, ItemAdded(item));
206 } 206 }
207 } 207 }
208 208
209 void DownloadUIAdapter::OnDeletePagesDone(DeletePageResult result) { 209 void DownloadUIAdapter::OnDeletePagesDone(DeletePageResult result) {
210 // TODO(dimich): Consider adding UMA to record user actions. 210 // TODO(dimich): Consider adding UMA to record user actions.
211 } 211 }
212 212
213 // static
213 bool DownloadUIAdapter::IsVisibleInUI(const ClientId& client_id) { 214 bool DownloadUIAdapter::IsVisibleInUI(const ClientId& client_id) {
214 const std::string& name_space = client_id.name_space; 215 const std::string& name_space = client_id.name_space;
215 return (name_space == kAsyncNamespace || name_space == kDownloadNamespace) && 216 return (name_space == kAsyncNamespace || name_space == kDownloadNamespace) &&
216 base::IsValidGUID(client_id.id); 217 base::IsValidGUID(client_id.id);
217 } 218 }
218 219
219 } // namespace offline_pages 220 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/downloads/download_ui_adapter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698