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

Side by Side Diff: chrome/browser/notifications/sync_notifier/synced_notification.cc

Issue 263563003: Add referrer & load flag support to BitmapFetcher class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include another missing header 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
« no previous file with comments | « chrome/browser/image_holder.cc ('k') | chrome/browser/profiles/profile_avatar_downloader.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 (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/notifications/sync_notifier/synced_notification.h" 5 #include "chrome/browser/notifications/sync_notifier/synced_notification.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/notifications/notification.h" 14 #include "chrome/browser/notifications/notification.h"
15 #include "chrome/browser/notifications/notification_ui_manager.h" 15 #include "chrome/browser/notifications/notification_ui_manager.h"
16 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.h" 16 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.h"
17 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" 17 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "net/base/load_flags.h"
20 #include "skia/ext/image_operations.h" 21 #include "skia/ext/image_operations.h"
21 #include "sync/protocol/sync.pb.h" 22 #include "sync/protocol/sync.pb.h"
22 #include "sync/protocol/synced_notification_specifics.pb.h" 23 #include "sync/protocol/synced_notification_specifics.pb.h"
23 #include "third_party/skia/include/core/SkPaint.h" 24 #include "third_party/skia/include/core/SkPaint.h"
24 #include "ui/gfx/canvas.h" 25 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/color_utils.h" 26 #include "ui/gfx/color_utils.h"
26 #include "ui/gfx/image/image.h" 27 #include "ui/gfx/image/image.h"
27 #include "ui/gfx/size.h" 28 #include "ui/gfx/size.h"
28 #include "ui/gfx/skbitmap_operations.h" 29 #include "ui/gfx/skbitmap_operations.h"
29 #include "ui/message_center/message_center_style.h" 30 #include "ui/message_center/message_center_style.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // See if all bitmaps are accounted for, if so call Show(). 277 // See if all bitmaps are accounted for, if so call Show().
277 if (AreAllBitmapsFetched()) { 278 if (AreAllBitmapsFetched()) {
278 Show(profile_); 279 Show(profile_);
279 } 280 }
280 } 281 }
281 282
282 void SyncedNotification::StartBitmapFetch() { 283 void SyncedNotification::StartBitmapFetch() {
283 // Now that we have queued and counted them all, start the fetching. 284 // Now that we have queued and counted them all, start the fetching.
284 ScopedVector<chrome::BitmapFetcher>::iterator iter; 285 ScopedVector<chrome::BitmapFetcher>::iterator iter;
285 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) { 286 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) {
286 (*iter)->Start(profile_->GetRequestContext()); 287 (*iter)->Start(
288 profile_->GetRequestContext(),
289 std::string(),
290 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
291 net::LOAD_NORMAL);
287 } 292 }
288 } 293 }
289 294
290 // This should detect even small changes in case the server updated the 295 // This should detect even small changes in case the server updated the
291 // notification. We ignore the timestamp if other fields match. 296 // notification. We ignore the timestamp if other fields match.
292 bool SyncedNotification::EqualsIgnoringReadState( 297 bool SyncedNotification::EqualsIgnoringReadState(
293 const SyncedNotification& other) const { 298 const SyncedNotification& other) const {
294 if (GetTitle() == other.GetTitle() && 299 if (GetTitle() == other.GetTitle() &&
295 GetHeading() == other.GetHeading() && 300 GetHeading() == other.GetHeading() &&
296 GetDescription() == other.GetDescription() && 301 GetDescription() == other.GetDescription() &&
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 specifics_.mutable_coalesced_notification()->set_read_state( 737 specifics_.mutable_coalesced_notification()->set_read_state(
733 sync_pb::CoalescedSyncedNotification_ReadState_UNREAD); 738 sync_pb::CoalescedSyncedNotification_ReadState_UNREAD);
734 else if (kRead == read_state) 739 else if (kRead == read_state)
735 specifics_.mutable_coalesced_notification()->set_read_state( 740 specifics_.mutable_coalesced_notification()->set_read_state(
736 sync_pb::CoalescedSyncedNotification_ReadState_READ); 741 sync_pb::CoalescedSyncedNotification_ReadState_READ);
737 else 742 else
738 NOTREACHED(); 743 NOTREACHED();
739 } 744 }
740 745
741 } // namespace notifier 746 } // namespace notifier
OLDNEW
« no previous file with comments | « chrome/browser/image_holder.cc ('k') | chrome/browser/profiles/profile_avatar_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698