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

Side by Side Diff: chrome/browser/ui/metro_pin_tab_helper_win.cc

Issue 12945007: Fix Notifications Icon loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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/metro_pin_tab_helper_win.h" 5 #include "chrome/browser/ui/metro_pin_tab_helper_win.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/ref_counted_memory.h" 15 #include "base/memory/ref_counted_memory.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
20 #include "base/win/metro.h" 20 #include "base/win/metro.h"
21 #include "chrome/browser/favicon/favicon_tab_helper.h" 21 #include "chrome/browser/favicon/favicon_tab_helper.h"
22 #include "chrome/browser/favicon/favicon_util.h" 22 #include "chrome/browser/favicon/favicon_util.h"
23 #include "chrome/common/chrome_paths.h" 23 #include "chrome/common/chrome_paths.h"
24 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/common/content_constants.h"
26 #include "crypto/sha2.h" 27 #include "crypto/sha2.h"
27 #include "third_party/skia/include/core/SkCanvas.h" 28 #include "third_party/skia/include/core/SkCanvas.h"
28 #include "third_party/skia/include/core/SkColor.h" 29 #include "third_party/skia/include/core/SkColor.h"
29 #include "ui/gfx/canvas.h" 30 #include "ui/gfx/canvas.h"
30 #include "ui/gfx/codec/png_codec.h" 31 #include "ui/gfx/codec/png_codec.h"
31 #include "ui/gfx/color_analysis.h" 32 #include "ui/gfx/color_analysis.h"
32 #include "ui/gfx/color_utils.h" 33 #include "ui/gfx/color_utils.h"
33 #include "ui/gfx/image/image.h" 34 #include "ui/gfx/image/image.h"
34 #include "ui/gfx/rect.h" 35 #include "ui/gfx/rect.h"
35 #include "ui/gfx/size.h" 36 #include "ui/gfx/size.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 return; 394 return;
394 } 395 }
395 396
396 // Request all the candidates. 397 // Request all the candidates.
397 int image_size = 0; // Request the full sized image. 398 int image_size = 0; // Request the full sized image.
398 for (std::vector<content::FaviconURL>::const_iterator iter = 399 for (std::vector<content::FaviconURL>::const_iterator iter =
399 favicon_url_candidates_.begin(); 400 favicon_url_candidates_.begin();
400 iter != favicon_url_candidates_.end(); 401 iter != favicon_url_candidates_.end();
401 ++iter) { 402 ++iter) {
402 favicon_chooser_->AddPendingRequest( 403 favicon_chooser_->AddPendingRequest(
403 web_contents()->DownloadFavicon(iter->icon_url, image_size, 404 web_contents()->DownloadFavicon(iter->icon_url,
405 content::DOWNLOAD_FAVICON, image_size,
404 base::Bind(&MetroPinTabHelper::DidDownloadFavicon, 406 base::Bind(&MetroPinTabHelper::DidDownloadFavicon,
405 base::Unretained(this)))); 407 base::Unretained(this))));
406 } 408 }
407 409
408 } 410 }
409 411
410 void MetroPinTabHelper::DidNavigateMainFrame( 412 void MetroPinTabHelper::DidNavigateMainFrame(
411 const content::LoadCommittedDetails& /*details*/, 413 const content::LoadCommittedDetails& /*details*/,
412 const content::FrameNavigateParams& /*params*/) { 414 const content::FrameNavigateParams& /*params*/) {
413 // Cancel any outstanding pin operations once the user navigates away from 415 // Cancel any outstanding pin operations once the user navigates away from
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 451
450 GURL url = web_contents()->GetURL(); 452 GURL url = web_contents()->GetURL();
451 string16 tile_id = GenerateTileId(UTF8ToUTF16(url.spec())); 453 string16 tile_id = GenerateTileId(UTF8ToUTF16(url.spec()));
452 metro_un_pin_from_start_screen(tile_id, 454 metro_un_pin_from_start_screen(tile_id,
453 base::Bind(&PinPageReportUmaCallback)); 455 base::Bind(&PinPageReportUmaCallback));
454 } 456 }
455 457
456 void MetroPinTabHelper::FaviconDownloaderFinished() { 458 void MetroPinTabHelper::FaviconDownloaderFinished() {
457 favicon_chooser_.reset(); 459 favicon_chooser_.reset();
458 } 460 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698