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

Side by Side Diff: chrome/browser/ui/tab_contents/core_tab_helper.cc

Issue 2943363003: Fixing transparent pixels appearing black when rendered for the context menu. (Closed)
Patch Set: creating and implementing ImageFormat enum 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 (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/tab_contents/core_tab_helper.h" 5 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 content::RenderFrameHost* render_frame_host, 112 content::RenderFrameHost* render_frame_host,
113 const GURL& src_url) { 113 const GURL& src_url) {
114 chrome::mojom::ThumbnailCapturerPtr thumbnail_capturer; 114 chrome::mojom::ThumbnailCapturerPtr thumbnail_capturer;
115 render_frame_host->GetRemoteInterfaces()->GetInterface(&thumbnail_capturer); 115 render_frame_host->GetRemoteInterfaces()->GetInterface(&thumbnail_capturer);
116 // Bind the InterfacePtr into the callback so that it's kept alive until 116 // Bind the InterfacePtr into the callback so that it's kept alive until
117 // there's either a connection error or a response. 117 // there's either a connection error or a response.
118 auto* thumbnail_capturer_proxy = thumbnail_capturer.get(); 118 auto* thumbnail_capturer_proxy = thumbnail_capturer.get();
119 thumbnail_capturer_proxy->RequestThumbnailForContextNode( 119 thumbnail_capturer_proxy->RequestThumbnailForContextNode(
120 kImageSearchThumbnailMinSize, 120 kImageSearchThumbnailMinSize,
121 gfx::Size(kImageSearchThumbnailMaxWidth, kImageSearchThumbnailMaxHeight), 121 gfx::Size(kImageSearchThumbnailMaxWidth, kImageSearchThumbnailMaxHeight),
122 chrome::mojom::ImageFormat::JPEG,
122 base::Bind(&CoreTabHelper::DoSearchByImageInNewTab, 123 base::Bind(&CoreTabHelper::DoSearchByImageInNewTab,
123 weak_factory_.GetWeakPtr(), base::Passed(&thumbnail_capturer), 124 weak_factory_.GetWeakPtr(), base::Passed(&thumbnail_capturer),
124 src_url)); 125 src_url));
125 } 126 }
126 127
127 // static 128 // static
128 bool CoreTabHelper::GetStatusTextForWebContents( 129 bool CoreTabHelper::GetStatusTextForWebContents(
129 base::string16* status_text, content::WebContents* source) { 130 base::string16* status_text, content::WebContents* source) {
130 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is 131 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is
131 // fixed. 132 // fixed.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 DCHECK(!content_type.empty()); 347 DCHECK(!content_type.empty());
347 open_url_params.uses_post = true; 348 open_url_params.uses_post = true;
348 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes( 349 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes(
349 post_data.data(), post_data.size()); 350 post_data.data(), post_data.size());
350 open_url_params.extra_headers += base::StringPrintf( 351 open_url_params.extra_headers += base::StringPrintf(
351 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, 352 "%s: %s\r\n", net::HttpRequestHeaders::kContentType,
352 content_type.c_str()); 353 content_type.c_str());
353 } 354 }
354 web_contents()->OpenURL(open_url_params); 355 web_contents()->OpenURL(open_url_params);
355 } 356 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/context_menu_helper.cc ('k') | chrome/common/thumbnail_capturer.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698