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

Unified Diff: chrome/browser/ui/pdf/pdf_tab_helper.cc

Issue 23478036: Create a PDF password dialog for Views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@pdf
Patch Set: fixes Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/pdf/pdf_tab_helper.h ('k') | chrome/browser/ui/views/pdf_password_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/pdf/pdf_tab_helper.cc
diff --git a/chrome/browser/ui/pdf/pdf_tab_helper.cc b/chrome/browser/ui/pdf/pdf_tab_helper.cc
index ef56c895a85ed2f77deb9bb14e440f5843c0348b..47851054a2b427e25b742170a2b21eda03efcb6d 100644
--- a/chrome/browser/ui/pdf/pdf_tab_helper.cc
+++ b/chrome/browser/ui/pdf/pdf_tab_helper.cc
@@ -6,7 +6,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/download/download_stats.h"
-#include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
@@ -15,9 +14,13 @@
#include "chrome/browser/ui/pdf/pdf_unsupported_feature.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/common/render_messages.h"
-#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/navigation_details.h"
+#if defined(TOOLKIT_GTK)
+#include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h"
+#include "content/public/browser/javascript_dialog_manager.h"
+#endif
+
DEFINE_WEB_CONTENTS_USER_DATA_KEY(PDFTabHelper);
PDFTabHelper::PDFTabHelper(content::WebContents* web_contents)
@@ -104,10 +107,11 @@ void PDFTabHelper::OnModalPromptForPassword(const std::string& prompt,
base::Callback<void(bool, const string16&)> callback =
base::Bind(&PDFTabHelper::OnModalPromptForPasswordClosed,
base::Unretained(this), reply_message);
-#if defined(OS_MACOSX)
+#if !defined(TOOLKIT_GTK)
ShowPDFPasswordDialog(web_contents(), base::UTF8ToUTF16(prompt), callback);
#else
- // Cheat (for now).
+ // GTK is going away, so it's not worth the effort to create a password dialog
+ // for it. Cheat (for now) until the GTK code is removed.
bool did_suppress_message;
GetJavaScriptDialogManagerInstance()->RunJavaScriptDialog(
web_contents(),
@@ -118,5 +122,5 @@ void PDFTabHelper::OnModalPromptForPassword(const std::string& prompt,
base::string16(),
callback,
&did_suppress_message);
-#endif // OS_*
+#endif // TOOLKIT_GTK
}
« no previous file with comments | « chrome/browser/ui/pdf/pdf_tab_helper.h ('k') | chrome/browser/ui/views/pdf_password_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698