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

Side by Side Diff: chrome/browser/ui/webui/large_icon_source.cc

Issue 1318523011: [Password Manager] Copiable username and origin. Linkable origin elided from the left. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Icons appearance fixed Created 5 years, 2 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 "chrome/browser/ui/webui/large_icon_source.h" 5 #include "chrome/browser/ui/webui/large_icon_source.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "chrome/browser/search/instant_io_context.h" 10 #include "chrome/browser/search/instant_io_context.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 GURL url(parser.url_string()); 58 GURL url(parser.url_string());
59 if (!url.is_valid()) { 59 if (!url.is_valid()) {
60 SendNotFoundResponse(callback); 60 SendNotFoundResponse(callback);
61 return; 61 return;
62 } 62 }
63 63
64 // TODO(beaudoin): Potentially allow icon to be scaled up. 64 // TODO(beaudoin): Potentially allow icon to be scaled up.
65 large_icon_service_->GetLargeIconOrFallbackStyle( 65 large_icon_service_->GetLargeIconOrFallbackStyle(
66 url, 66 url,
67 parser.size_in_pixels(), // Reducing this will enable scale up. 67 parser.size_in_pixels(), // Reducing this will enable scale up.
68 parser.size_in_pixels(), 68 parser.size_in_pixels(), parser.fallback_icon_style(),
69 base::Bind(&LargeIconSource::OnLargeIconDataAvailable, 69 base::Bind(&LargeIconSource::OnLargeIconDataAvailable,
70 base::Unretained(this), callback, url, 70 base::Unretained(this), callback, url,
71 parser.size_in_pixels()), 71 parser.size_in_pixels()),
72 &cancelable_task_tracker_); 72 &cancelable_task_tracker_);
73 } 73 }
74 74
75 std::string LargeIconSource::GetMimeType(const std::string&) const { 75 std::string LargeIconSource::GetMimeType(const std::string&) const {
76 // We need to explicitly return a mime type, otherwise if the user tries to 76 // We need to explicitly return a mime type, otherwise if the user tries to
77 // drag the image they get no extension. 77 // drag the image they get no extension.
78 return "image/png"; 78 return "image/png";
(...skipping 30 matching lines...) Expand all
109 std::vector<unsigned char> bitmap_data = 109 std::vector<unsigned char> bitmap_data =
110 fallback_icon_service_->RenderFallbackIconBitmap( 110 fallback_icon_service_->RenderFallbackIconBitmap(
111 url, size, *result.fallback_icon_style); 111 url, size, *result.fallback_icon_style);
112 callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data)); 112 callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data));
113 } 113 }
114 114
115 void LargeIconSource::SendNotFoundResponse( 115 void LargeIconSource::SendNotFoundResponse(
116 const content::URLDataSource::GotDataCallback& callback) { 116 const content::URLDataSource::GotDataCallback& callback) {
117 callback.Run(nullptr); 117 callback.Run(nullptr);
118 } 118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698