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

Side by Side Diff: chrome/renderer/chrome_render_frame_observer.cc

Issue 939713003: Enabled the "search web for image" context menu item when "Yandex" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/chrome_render_frame_observer.h" 5 #include "chrome/renderer/chrome_render_frame_observer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const int kDefaultQuality = 90; 144 const int kDefaultQuality = 90;
145 std::vector<unsigned char> data; 145 std::vector<unsigned char> data;
146 if (gfx::JPEGCodec::Encode( 146 if (gfx::JPEGCodec::Encode(
147 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), 147 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)),
148 gfx::JPEGCodec::FORMAT_SkBitmap, bitmap.width(), bitmap.height(), 148 gfx::JPEGCodec::FORMAT_SkBitmap, bitmap.width(), bitmap.height(),
149 static_cast<int>(bitmap.rowBytes()), kDefaultQuality, &data)) 149 static_cast<int>(bitmap.rowBytes()), kDefaultQuality, &data))
150 thumbnail_data = std::string(data.begin(), data.end()); 150 thumbnail_data = std::string(data.begin(), data.end());
151 } 151 }
152 152
153 Send(new ChromeViewHostMsg_RequestThumbnailForContextNode_ACK( 153 Send(new ChromeViewHostMsg_RequestThumbnailForContextNode_ACK(
154 routing_id(), thumbnail_data, original_size)); 154 routing_id(), thumbnail_data, "jpeg", original_size));
155 } 155 }
156 156
157 void ChromeRenderFrameObserver::OnPrintNodeUnderContextMenu() { 157 void ChromeRenderFrameObserver::OnPrintNodeUnderContextMenu() {
158 printing::PrintWebViewHelper* helper = 158 printing::PrintWebViewHelper* helper =
159 printing::PrintWebViewHelper::Get(render_frame()->GetRenderView()); 159 printing::PrintWebViewHelper::Get(render_frame()->GetRenderView());
160 if (helper) 160 if (helper)
161 helper->PrintNode(render_frame()->GetContextMenuNode()); 161 helper->PrintNode(render_frame()->GetContextMenuNode());
162 } 162 }
163 163
164 void ChromeRenderFrameObserver::DidFinishDocumentLoad() { 164 void ChromeRenderFrameObserver::DidFinishDocumentLoad() {
(...skipping 18 matching lines...) Expand all
183 blink::WebConsoleMessage::LevelWarning, 183 blink::WebConsoleMessage::LevelWarning,
184 base::ASCIIToUTF16( 184 base::ASCIIToUTF16(
185 "This site does not have a valid SSL " 185 "This site does not have a valid SSL "
186 "certificate! Without SSL, your site's and " 186 "certificate! Without SSL, your site's and "
187 "visitors' data is vulnerable to theft and " 187 "visitors' data is vulnerable to theft and "
188 "tampering. Get a valid SSL certificate before" 188 "tampering. Get a valid SSL certificate before"
189 " releasing your website to the public."))); 189 " releasing your website to the public.")));
190 } 190 }
191 } 191 }
192 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698