| 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_unsupported_feature.h" | 5 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 return l10n_util::GetStringUTF16(IDS_DONE); | 285 return l10n_util::GetStringUTF16(IDS_DONE); |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool PDFUnsupportedFeaturePromptClient::ShouldExpire( | 288 bool PDFUnsupportedFeaturePromptClient::ShouldExpire( |
| 289 const content::LoadCommittedDetails& details) const { | 289 const content::LoadCommittedDetails& details) const { |
| 290 return !details.is_in_page; | 290 return !details.is_in_page; |
| 291 } | 291 } |
| 292 | 292 |
| 293 void PDFUnsupportedFeaturePromptClient::Accept() { | 293 void PDFUnsupportedFeaturePromptClient::Accept() { |
| 294 if (base::win::IsMetroProcess()) { | 294 if (base::win::IsMetroProcess()) { |
| 295 chrome::AttemptRestartWithModeSwitch(); | 295 chrome::AttemptRestartToDesktopMode(); |
| 296 return; | 296 return; |
| 297 } | 297 } |
| 298 | 298 |
| 299 if (!reader_info_.is_installed) { | 299 if (!reader_info_.is_installed) { |
| 300 content::RecordAction(UserMetricsAction("PDF_InstallReaderInfoBarOK")); | 300 content::RecordAction(UserMetricsAction("PDF_InstallReaderInfoBarOK")); |
| 301 OpenReaderUpdateURL(web_contents_); | 301 OpenReaderUpdateURL(web_contents_); |
| 302 return; | 302 return; |
| 303 } | 303 } |
| 304 | 304 |
| 305 content::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarOK")); | 305 content::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarOK")); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); | 360 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); |
| 361 return; | 361 return; |
| 362 } | 362 } |
| 363 GetAdobeReaderPluginInfoAsync( | 363 GetAdobeReaderPluginInfoAsync( |
| 364 profile, | 364 profile, |
| 365 base::Bind(&GotPluginsCallback, | 365 base::Bind(&GotPluginsCallback, |
| 366 web_contents->GetRenderProcessHost()->GetID(), | 366 web_contents->GetRenderProcessHost()->GetID(), |
| 367 web_contents->GetRenderViewHost()->GetRoutingID())); | 367 web_contents->GetRenderViewHost()->GetRoutingID())); |
| 368 #endif // defined(OS_WIN) | 368 #endif // defined(OS_WIN) |
| 369 } | 369 } |
| OLD | NEW |