Chromium Code Reviews| Index: chrome/browser/ui/tab_contents/core_tab_helper.cc |
| diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc |
| index 41cbc7e91397ef8f3ff1dc477511b3dfabb009fc..5e728d63c276c0a1fe2b1feedd854c213ae55a77 100644 |
| --- a/chrome/browser/ui/tab_contents/core_tab_helper.cc |
| +++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc |
| @@ -202,10 +202,11 @@ bool CoreTabHelper::OnMessageReceived( |
| // Handles the image thumbnail for the context node, composes a image search |
| // request based on the received thumbnail and opens the request in a new tab. |
| void CoreTabHelper::OnRequestThumbnailForContextNodeACK( |
| - const SkBitmap& bitmap, |
| + const std::string& thumbnail_data, |
| const gfx::Size& original_size) { |
| - if (bitmap.isNull()) |
| + if (thumbnail_data.empty()) |
| return; |
| + |
| Profile* profile = |
| Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| @@ -218,18 +219,9 @@ void CoreTabHelper::OnRequestThumbnailForContextNodeACK( |
| if (!default_provider) |
| return; |
| - const int kDefaultQualityForImageSearch = 90; |
| - std::vector<unsigned char> data; |
| - if (!gfx::JPEGCodec::Encode( |
| - reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), |
| - gfx::JPEGCodec::FORMAT_SkBitmap, bitmap.width(), bitmap.height(), |
| - static_cast<int>(bitmap.rowBytes()), kDefaultQualityForImageSearch, |
| - &data)) |
| - return; |
| - |
| TemplateURLRef::SearchTermsArgs search_args = |
| TemplateURLRef::SearchTermsArgs(base::string16()); |
| - search_args.image_thumbnail_content = std::string(data.begin(), data.end()); |
| + search_args.image_thumbnail_content = thumbnail_data; |
|
sky
2014/12/11 20:26:49
My question is why this is a string and not a SkBi
Peter Kasting
2014/12/11 20:55:33
We're going to pass it to the search engine as tex
sky
2014/12/11 21:09:42
That makes sense. Thanks for the clarification. Th
|
| // TODO(jnd): Add a method in WebContentsViewDelegate to get the image URL |
| // from the ContextMenuParams which creates current context menu. |
| search_args.image_url = GURL(); |