| 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/browser/ui/pdf/pdf_tab_helper.h" | 5 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/browser/ui/omnibox/location_bar.h" | 10 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 11 #include "chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h" | 11 #include "chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h" |
| 12 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" | 12 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" |
| 13 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 14 #include "content/public/browser/navigation_details.h" | 14 #include "content/public/browser/navigation_details.h" |
| 15 | 15 |
| 16 int PDFTabHelper::kUserDataKey; | 16 DEFINE_WEB_CONTENTS_USER_DATA_KEY(PDFTabHelper) |
| 17 | 17 |
| 18 PDFTabHelper::PDFTabHelper(content::WebContents* web_contents) | 18 PDFTabHelper::PDFTabHelper(content::WebContents* web_contents) |
| 19 : content::WebContentsObserver(web_contents) { | 19 : content::WebContentsObserver(web_contents) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 PDFTabHelper::~PDFTabHelper() { | 22 PDFTabHelper::~PDFTabHelper() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 void PDFTabHelper::ShowOpenInReaderPrompt( | 25 void PDFTabHelper::ShowOpenInReaderPrompt( |
| 26 scoped_ptr<OpenPDFInReaderPromptDelegate> prompt) { | 26 scoped_ptr<OpenPDFInReaderPromptDelegate> prompt) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 LocationBar* location_bar = window->GetLocationBar(); | 60 LocationBar* location_bar = window->GetLocationBar(); |
| 61 if (!location_bar) | 61 if (!location_bar) |
| 62 return; | 62 return; |
| 63 | 63 |
| 64 location_bar->UpdateOpenPDFInReaderPrompt(); | 64 location_bar->UpdateOpenPDFInReaderPrompt(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void PDFTabHelper::OnPDFHasUnsupportedFeature() { | 67 void PDFTabHelper::OnPDFHasUnsupportedFeature() { |
| 68 PDFHasUnsupportedFeature(web_contents()); | 68 PDFHasUnsupportedFeature(web_contents()); |
| 69 } | 69 } |
| OLD | NEW |