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

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

Issue 7709020: Moving the ViewHostMsg_PDFHasUnsupportedFeature IPC message to Chrome as PDF is a chrome specific (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_ppb_pdf_impl.h" 5 #include "chrome/renderer/chrome_ppb_pdf_impl.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/render_messages.h"
10 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/renderer/pepper_plugin_delegate_impl.h"
11 #include "content/renderer/render_thread.h" 13 #include "content/renderer/render_thread.h"
12 #include "grit/webkit_resources.h" 14 #include "grit/webkit_resources.h"
13 #include "grit/webkit_strings.h" 15 #include "grit/webkit_strings.h"
14 #include "ppapi/c/pp_resource.h" 16 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/private/ppb_pdf.h" 17 #include "ppapi/c/private/ppb_pdf.h"
16 #include "ppapi/shared_impl/resource.h" 18 #include "ppapi/shared_impl/resource.h"
17 #include "ppapi/shared_impl/resource_tracker.h" 19 #include "ppapi/shared_impl/resource_tracker.h"
18 #include "ppapi/shared_impl/tracker_base.h" 20 #include "ppapi/shared_impl/tracker_base.h"
19 #include "ppapi/shared_impl/var.h" 21 #include "ppapi/shared_impl/var.h"
20 #include "skia/ext/platform_canvas.h" 22 #include "skia/ext/platform_canvas.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 void HasUnsupportedFeature(PP_Instance instance_id) { 315 void HasUnsupportedFeature(PP_Instance instance_id) {
314 webkit::ppapi::PluginInstance* instance = 316 webkit::ppapi::PluginInstance* instance =
315 webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); 317 webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id);
316 if (!instance) 318 if (!instance)
317 return; 319 return;
318 320
319 // Only want to show an info bar if the pdf is the whole tab. 321 // Only want to show an info bar if the pdf is the whole tab.
320 if (!instance->IsFullPagePlugin()) 322 if (!instance->IsFullPagePlugin())
321 return; 323 return;
322 324
323 instance->delegate()->HasUnsupportedFeature(); 325 PepperPluginDelegateImpl* pepper_delegate =
326 static_cast<PepperPluginDelegateImpl*>(instance->delegate());
327
328 RenderThread::current()->Send(
329 new ChromeViewHostMsg_PDFHasUnsupportedFeature(
330 pepper_delegate->GetRoutingId()));
324 } 331 }
325 332
326 void SaveAs(PP_Instance instance_id) { 333 void SaveAs(PP_Instance instance_id) {
327 webkit::ppapi::PluginInstance* instance = 334 webkit::ppapi::PluginInstance* instance =
328 webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); 335 webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id);
329 if (!instance) 336 if (!instance)
330 return; 337 return;
331 instance->delegate()->SaveURLAs(instance->plugin_url()); 338 instance->delegate()->SaveURLAs(instance->plugin_url());
332 } 339 }
333 340
(...skipping 12 matching lines...) Expand all
346 &SaveAs 353 &SaveAs
347 }; 354 };
348 355
349 // static 356 // static
350 const PPB_PDF* PPB_PDF_Impl::GetInterface() { 357 const PPB_PDF* PPB_PDF_Impl::GetInterface() {
351 return &ppb_pdf; 358 return &ppb_pdf;
352 } 359 }
353 360
354 } // namespace chrome 361 } // namespace chrome
355 362
OLDNEW
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698