OLD | NEW |
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/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 "chrome/common/render_messages.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (!instance) | 329 if (!instance) |
330 return; | 330 return; |
331 | 331 |
332 // Only want to show an info bar if the pdf is the whole tab. | 332 // Only want to show an info bar if the pdf is the whole tab. |
333 if (!instance->IsFullPagePlugin()) | 333 if (!instance->IsFullPagePlugin()) |
334 return; | 334 return; |
335 | 335 |
336 WebView* view = instance->container()->element().document().frame()->view(); | 336 WebView* view = instance->container()->element().document().frame()->view(); |
337 content::RenderView* render_view = content::RenderView::FromWebView(view); | 337 content::RenderView* render_view = content::RenderView::FromWebView(view); |
338 render_view->Send(new ChromeViewHostMsg_PDFHasUnsupportedFeature( | 338 render_view->Send(new ChromeViewHostMsg_PDFHasUnsupportedFeature( |
339 render_view->GetRoutingId())); | 339 render_view->GetRoutingID())); |
340 } | 340 } |
341 | 341 |
342 void SaveAs(PP_Instance instance_id) { | 342 void SaveAs(PP_Instance instance_id) { |
343 PluginInstance* instance = | 343 PluginInstance* instance = |
344 content::GetHostGlobals()->GetInstance(instance_id); | 344 content::GetHostGlobals()->GetInstance(instance_id); |
345 if (!instance) | 345 if (!instance) |
346 return; | 346 return; |
347 instance->delegate()->SaveURLAs(instance->plugin_url()); | 347 instance->delegate()->SaveURLAs(instance->plugin_url()); |
348 } | 348 } |
349 | 349 |
(...skipping 27 matching lines...) Expand all Loading... |
377 &SaveAs, | 377 &SaveAs, |
378 &Print | 378 &Print |
379 }; | 379 }; |
380 | 380 |
381 // static | 381 // static |
382 const PPB_PDF* PPB_PDF_Impl::GetInterface() { | 382 const PPB_PDF* PPB_PDF_Impl::GetInterface() { |
383 return &ppb_pdf; | 383 return &ppb_pdf; |
384 } | 384 } |
385 | 385 |
386 } // namespace chrome | 386 } // namespace chrome |
OLD | NEW |