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

Unified Diff: content/shell/shell_javascript_dialog_creator.h

Issue 9836127: Content shell: Javascript dialogs, first pass, just Mac for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef out for non-mac Created 8 years, 9 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 | « content/shell/shell_javascript_dialog.h ('k') | content/shell/shell_javascript_dialog_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_javascript_dialog_creator.h
diff --git a/content/shell/shell_javascript_dialog_creator.h b/content/shell/shell_javascript_dialog_creator.h
new file mode 100644
index 0000000000000000000000000000000000000000..88e5db653d2f9bd30a950197ad5ee5de514620f1
--- /dev/null
+++ b/content/shell/shell_javascript_dialog_creator.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_CREATOR_H_
+#define CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_CREATOR_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/javascript_dialogs.h"
+
+namespace content {
+
+class ShellJavaScriptDialog;
+
+class ShellJavaScriptDialogCreator : public JavaScriptDialogCreator {
+ public:
+ ShellJavaScriptDialogCreator();
+ virtual ~ShellJavaScriptDialogCreator();
+
+ // JavaScriptDialogCreator:
+ virtual void RunJavaScriptDialog(
+ WebContents* web_contents,
+ const GURL& origin_url,
+ const std::string& accept_lang,
+ ui::JavascriptMessageType javascript_message_type,
+ const string16& message_text,
+ const string16& default_prompt_text,
+ const DialogClosedCallback& callback,
+ bool* did_suppress_message) OVERRIDE;
+
+ virtual void RunBeforeUnloadDialog(
+ WebContents* web_contents,
+ const string16& message_text,
+ bool is_reload,
+ const DialogClosedCallback& callback) OVERRIDE;
+
+ virtual void ResetJavaScriptState(WebContents* web_contents) OVERRIDE;
+
+ // Called by the ShellJavaScriptDialog when it closes.
+ void DialogClosed(ShellJavaScriptDialog* dialog);
+
+ private:
+#if defined(OS_MACOSX)
+ // The dialog being shown. No queueing.
+ scoped_ptr<ShellJavaScriptDialog> dialog_;
+#else
+ // TODO: implement ShellJavaScriptDialog for other platforms, drop this #if
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogCreator);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_CREATOR_H_
« no previous file with comments | « content/shell/shell_javascript_dialog.h ('k') | content/shell/shell_javascript_dialog_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698