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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync up to r199996 Created 7 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 | Annotate | Revision Log
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/ui/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/app_window_contents.h" 9 #include "chrome/browser/extensions/app_window_contents.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 416 }
417 417
418 //------------------------------------------------------------------------------ 418 //------------------------------------------------------------------------------
419 // Private methods 419 // Private methods
420 420
421 void ShellWindow::OnImageLoaded(const gfx::Image& image) { 421 void ShellWindow::OnImageLoaded(const gfx::Image& image) {
422 UpdateAppIcon(image); 422 UpdateAppIcon(image);
423 } 423 }
424 424
425 void ShellWindow::DidDownloadFavicon(int id, 425 void ShellWindow::DidDownloadFavicon(int id,
426 int http_status_code,
426 const GURL& image_url, 427 const GURL& image_url,
427 int requested_size, 428 int requested_size,
428 const std::vector<SkBitmap>& bitmaps) { 429 const std::vector<SkBitmap>& bitmaps) {
429 if (image_url != app_icon_url_ || bitmaps.empty()) 430 if (image_url != app_icon_url_ || bitmaps.empty())
430 return; 431 return;
431 432
432 // Bitmaps are ordered largest to smallest. Choose the smallest bitmap 433 // Bitmaps are ordered largest to smallest. Choose the smallest bitmap
433 // whose height >= the preferred size. 434 // whose height >= the preferred size.
434 int largest_index = 0; 435 int largest_index = 0;
435 for (size_t i = 1; i < bitmaps.size(); ++i) { 436 for (size_t i = 1; i < bitmaps.size(); ++i) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 const extensions::DraggableRegion& region = *iter; 591 const extensions::DraggableRegion& region = *iter;
591 sk_region->op( 592 sk_region->op(
592 region.bounds.x(), 593 region.bounds.x(),
593 region.bounds.y(), 594 region.bounds.y(),
594 region.bounds.right(), 595 region.bounds.right(),
595 region.bounds.bottom(), 596 region.bounds.bottom(),
596 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 597 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
597 } 598 }
598 return sk_region; 599 return sk_region;
599 } 600 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/browser/ui/metro_pin_tab_helper_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698