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

Side by Side Diff: extensions/browser/app_window/app_window.cc

Issue 934693002: Reload favicon from HTTP cache on Ctrl+Refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « content/renderer/image_loading_helper.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/app_window/app_window.h" 5 #include "extensions/browser/app_window/app_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 // Avoid using any previous icons that were being downloaded. 519 // Avoid using any previous icons that were being downloaded.
520 image_loader_ptr_factory_.InvalidateWeakPtrs(); 520 image_loader_ptr_factory_.InvalidateWeakPtrs();
521 521
522 // Reset |app_icon_image_| to abort pending image load (if any). 522 // Reset |app_icon_image_| to abort pending image load (if any).
523 app_icon_image_.reset(); 523 app_icon_image_.reset();
524 524
525 app_icon_url_ = url; 525 app_icon_url_ = url;
526 web_contents()->DownloadImage( 526 web_contents()->DownloadImage(
527 url, 527 url,
528 true, // is a favicon 528 true, // is a favicon
529 0, // no maximum size 529 0, // no maximum size
530 false, // normal cache policy
530 base::Bind(&AppWindow::DidDownloadFavicon, 531 base::Bind(&AppWindow::DidDownloadFavicon,
531 image_loader_ptr_factory_.GetWeakPtr())); 532 image_loader_ptr_factory_.GetWeakPtr()));
532 } 533 }
533 534
534 void AppWindow::SetBadgeIconUrl(const GURL& url) { 535 void AppWindow::SetBadgeIconUrl(const GURL& url) {
535 // Avoid using any previous icons that were being downloaded. 536 // Avoid using any previous icons that were being downloaded.
536 image_loader_ptr_factory_.InvalidateWeakPtrs(); 537 image_loader_ptr_factory_.InvalidateWeakPtrs();
537 538
538 // Reset |app_icon_image_| to abort pending image load (if any). 539 // Reset |app_icon_image_| to abort pending image load (if any).
539 badge_icon_image_.reset(); 540 badge_icon_image_.reset();
540 541
541 badge_icon_url_ = url; 542 badge_icon_url_ = url;
542 web_contents()->DownloadImage( 543 web_contents()->DownloadImage(
543 url, 544 url,
544 true, // is a favicon 545 true, // is a favicon
545 0, // no maximum size 546 0, // no maximum size
547 false, // normal cache policy
546 base::Bind(&AppWindow::DidDownloadFavicon, 548 base::Bind(&AppWindow::DidDownloadFavicon,
547 image_loader_ptr_factory_.GetWeakPtr())); 549 image_loader_ptr_factory_.GetWeakPtr()));
548 } 550 }
549 551
550 void AppWindow::ClearBadge() { 552 void AppWindow::ClearBadge() {
551 badge_icon_image_.reset(); 553 badge_icon_image_.reset();
552 badge_icon_url_ = GURL(); 554 badge_icon_url_ = GURL();
553 UpdateBadgeIcon(gfx::Image()); 555 UpdateBadgeIcon(gfx::Image());
554 } 556 }
555 557
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 region.bounds.x(), 1092 region.bounds.x(),
1091 region.bounds.y(), 1093 region.bounds.y(),
1092 region.bounds.right(), 1094 region.bounds.right(),
1093 region.bounds.bottom(), 1095 region.bounds.bottom(),
1094 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1096 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1095 } 1097 }
1096 return sk_region; 1098 return sk_region;
1097 } 1099 }
1098 1100
1099 } // namespace extensions 1101 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/image_loading_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698