| OLD | NEW |
| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "crypto/sha2.h" | 25 #include "crypto/sha2.h" |
| 26 #include "third_party/skia/include/core/SkCanvas.h" | 26 #include "third_party/skia/include/core/SkCanvas.h" |
| 27 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
| 28 #include "ui/gfx/canvas.h" | 28 #include "ui/gfx/canvas.h" |
| 29 #include "ui/gfx/codec/png_codec.h" | 29 #include "ui/gfx/codec/png_codec.h" |
| 30 #include "ui/gfx/color_analysis.h" | 30 #include "ui/gfx/color_analysis.h" |
| 31 #include "ui/gfx/color_utils.h" | 31 #include "ui/gfx/color_utils.h" |
| 32 #include "ui/gfx/geometry/rect.h" | 32 #include "ui/gfx/geometry/rect.h" |
| 33 #include "ui/gfx/geometry/size.h" |
| 33 #include "ui/gfx/image/image.h" | 34 #include "ui/gfx/image/image.h" |
| 34 #include "ui/gfx/size.h" | |
| 35 | 35 |
| 36 DEFINE_WEB_CONTENTS_USER_DATA_KEY(MetroPinTabHelper); | 36 DEFINE_WEB_CONTENTS_USER_DATA_KEY(MetroPinTabHelper); |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 // Histogram name for site-specific tile pinning metrics. | 40 // Histogram name for site-specific tile pinning metrics. |
| 41 const char kMetroPinMetric[] = "Metro.SecondaryTilePin"; | 41 const char kMetroPinMetric[] = "Metro.SecondaryTilePin"; |
| 42 | 42 |
| 43 // Generate an ID for the tile based on |url_str|. The ID is simply a hash of | 43 // Generate an ID for the tile based on |url_str|. The ID is simply a hash of |
| 44 // the URL. | 44 // the URL. |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 448 |
| 449 GURL url = web_contents()->GetURL(); | 449 GURL url = web_contents()->GetURL(); |
| 450 base::string16 tile_id = GenerateTileId(base::UTF8ToUTF16(url.spec())); | 450 base::string16 tile_id = GenerateTileId(base::UTF8ToUTF16(url.spec())); |
| 451 metro_un_pin_from_start_screen(tile_id, | 451 metro_un_pin_from_start_screen(tile_id, |
| 452 base::Bind(&PinPageReportUmaCallback)); | 452 base::Bind(&PinPageReportUmaCallback)); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void MetroPinTabHelper::FaviconDownloaderFinished() { | 455 void MetroPinTabHelper::FaviconDownloaderFinished() { |
| 456 favicon_chooser_.reset(); | 456 favicon_chooser_.reset(); |
| 457 } | 457 } |
| OLD | NEW |