Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/pdf/renderer/pepper_pdf_host.h" | 5 #include "components/pdf/renderer/pepper_pdf_host.h" |
| 6 | 6 |
| 7 #include "components/pdf/common/pdf_messages.h" | 7 #include "components/pdf/common/pdf_messages.h" |
| 8 #include "components/pdf/renderer/pdf_accessibility_tree.h" | 8 #include "components/pdf/renderer/pdf_accessibility_tree.h" |
| 9 #include "content/public/common/referrer.h" | 9 #include "content/public/common/referrer.h" |
| 10 #include "content/public/renderer/pepper_plugin_instance.h" | 10 #include "content/public/renderer/pepper_plugin_instance.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 return PP_OK; | 135 return PP_OK; |
| 136 } | 136 } |
| 137 | 137 |
| 138 int32_t PepperPDFHost::OnHostMsgHasUnsupportedFeature( | 138 int32_t PepperPDFHost::OnHostMsgHasUnsupportedFeature( |
| 139 ppapi::host::HostMessageContext* context) { | 139 ppapi::host::HostMessageContext* context) { |
| 140 content::PepperPluginInstance* instance = | 140 content::PepperPluginInstance* instance = |
| 141 host_->GetPluginInstance(pp_instance()); | 141 host_->GetPluginInstance(pp_instance()); |
| 142 if (!instance) | 142 if (!instance) |
| 143 return PP_ERROR_FAILED; | 143 return PP_ERROR_FAILED; |
| 144 | 144 |
| 145 // TODO(thestig): Turn CHECKs into the proper if statement after figuring ut | |
|
tommycli
2016/07/13 21:51:02
nit: "figuring ut" typo
Lei Zhang
2016/07/13 21:52:45
Clearly a case of packet loss between chair and ke
| |
| 146 // what's wrong for https://crbug.com/627814 | |
| 147 CHECK(instance->GetContainer()); | |
| 148 CHECK(instance->GetContainer()->document().frame()); | |
| 149 CHECK(instance->GetContainer()->document().frame()->view()); | |
| 145 blink::WebView* view = | 150 blink::WebView* view = |
| 146 instance->GetContainer()->document().frame()->view(); | 151 instance->GetContainer()->document().frame()->view(); |
| 147 content::RenderView* render_view = content::RenderView::FromWebView(view); | 152 content::RenderView* render_view = content::RenderView::FromWebView(view); |
| 148 render_view->Send( | 153 render_view->Send( |
| 149 new PDFHostMsg_PDFHasUnsupportedFeature(render_view->GetRoutingID())); | 154 new PDFHostMsg_PDFHasUnsupportedFeature(render_view->GetRoutingID())); |
| 150 return PP_OK; | 155 return PP_OK; |
| 151 } | 156 } |
| 152 | 157 |
| 153 int32_t PepperPDFHost::OnHostMsgPrint( | 158 int32_t PepperPDFHost::OnHostMsgPrint( |
| 154 ppapi::host::HostMessageContext* context) { | 159 ppapi::host::HostMessageContext* context) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 240 |
| 236 void PepperPDFHost::CreatePdfAccessibilityTreeIfNeeded( | 241 void PepperPDFHost::CreatePdfAccessibilityTreeIfNeeded( |
| 237 content::PepperPluginInstance* instance) { | 242 content::PepperPluginInstance* instance) { |
| 238 if (!pdf_accessibility_tree_) { | 243 if (!pdf_accessibility_tree_) { |
| 239 pdf_accessibility_tree_.reset( | 244 pdf_accessibility_tree_.reset( |
| 240 new PdfAccessibilityTree(instance->GetRenderView())); | 245 new PdfAccessibilityTree(instance->GetRenderView())); |
| 241 } | 246 } |
| 242 } | 247 } |
| 243 | 248 |
| 244 } // namespace pdf | 249 } // namespace pdf |
| OLD | NEW |