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

Side by Side Diff: ios/chrome/browser/favicon/favicon_client_impl.mm

Issue 2970863002: Removing ui-alternatives (Closed)
Patch Set: Rebase Created 3 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/favicon/favicon_client_impl.h" 5 #include "ios/chrome/browser/favicon/favicon_client_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 14 matching lines...) Expand all
25 #error "This file requires ARC support." 25 #error "This file requires ARC support."
26 #endif 26 #endif
27 27
28 namespace { 28 namespace {
29 29
30 int GetFaviconResourceIdForNativeURL(const GURL& url) { 30 int GetFaviconResourceIdForNativeURL(const GURL& url) {
31 if (url.host_piece() == kChromeUICrashesHost) 31 if (url.host_piece() == kChromeUICrashesHost)
32 return IDR_CRASH_SAD_FAVICON; 32 return IDR_CRASH_SAD_FAVICON;
33 if (url.host_piece() == kChromeUIFlagsHost) 33 if (url.host_piece() == kChromeUIFlagsHost)
34 return IDR_FLAGS_FAVICON; 34 return IDR_FLAGS_FAVICON;
35 if (url.host_piece() == kChromeUIAppleFlagsHost)
36 return IDR_FLAGS_FAVICON;
37 return -1; 35 return -1;
38 } 36 }
39 37
40 void GetFaviconBitmapForNativeURL( 38 void GetFaviconBitmapForNativeURL(
41 const GURL& url, 39 const GURL& url,
42 const std::vector<int>& desired_sizes_in_pixel, 40 const std::vector<int>& desired_sizes_in_pixel,
43 std::vector<favicon_base::FaviconRawBitmapResult>* favicon_bitmap_results) { 41 std::vector<favicon_base::FaviconRawBitmapResult>* favicon_bitmap_results) {
44 const int resource_id = GetFaviconResourceIdForNativeURL(url); 42 const int resource_id = GetFaviconResourceIdForNativeURL(url);
45 if (resource_id == -1) 43 if (resource_id == -1)
46 return; 44 return;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 auto favicon_bitmap_results = 96 auto favicon_bitmap_results =
99 base::MakeUnique<std::vector<favicon_base::FaviconRawBitmapResult>>(); 97 base::MakeUnique<std::vector<favicon_base::FaviconRawBitmapResult>>();
100 GetFaviconBitmapForNativeURL(url, desired_sizes_in_pixel, 98 GetFaviconBitmapForNativeURL(url, desired_sizes_in_pixel,
101 favicon_bitmap_results.get()); 99 favicon_bitmap_results.get());
102 100
103 return tracker->PostTask( 101 return tracker->PostTask(
104 base::ThreadTaskRunnerHandle::Get().get(), FROM_HERE, 102 base::ThreadTaskRunnerHandle::Get().get(), FROM_HERE,
105 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner, 103 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner,
106 callback, base::Owned(favicon_bitmap_results.release()))); 104 callback, base::Owned(favicon_bitmap_results.release())));
107 } 105 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/chrome_url_constants.cc ('k') | ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698