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

Unified Diff: components/app_modal_dialogs/javascript_app_modal_dialog.h

Issue 735473002: Rename app_modal_dialogs dir to app_modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 6 years, 1 month 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
Index: components/app_modal_dialogs/javascript_app_modal_dialog.h
diff --git a/components/app_modal_dialogs/javascript_app_modal_dialog.h b/components/app_modal_dialogs/javascript_app_modal_dialog.h
deleted file mode 100644
index 6fb07772fc9789bc95379a8bb34e1da6c9cf591d..0000000000000000000000000000000000000000
--- a/components/app_modal_dialogs/javascript_app_modal_dialog.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// 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 COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
-#define COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/time/time.h"
-#include "components/app_modal_dialogs/app_modal_dialog.h"
-#include "content/public/browser/javascript_dialog_manager.h"
-
-// Extra data for JavaScript dialogs to add Chrome-only features.
-class ChromeJavaScriptDialogExtraData {
- public:
- ChromeJavaScriptDialogExtraData();
-
- // The time that the last JavaScript dialog was dismissed.
- base::TimeTicks last_javascript_message_dismissal_;
-
- // True if the user has decided to block future JavaScript dialogs.
- bool suppress_javascript_messages_;
-};
-
-// A controller + model class for JavaScript alert, confirm, prompt, and
-// onbeforeunload dialog boxes.
-class JavaScriptAppModalDialog : public AppModalDialog {
- public:
- typedef std::map<void*, ChromeJavaScriptDialogExtraData> ExtraDataMap;
-
- JavaScriptAppModalDialog(
- content::WebContents* web_contents,
- ExtraDataMap* extra_data_map,
- const base::string16& title,
- content::JavaScriptMessageType javascript_message_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
- bool display_suppress_checkbox,
- bool is_before_unload_dialog,
- bool is_reload,
- const content::JavaScriptDialogManager::DialogClosedCallback& callback);
- ~JavaScriptAppModalDialog() override;
-
- // Overridden from AppModalDialog:
- NativeAppModalDialog* CreateNativeDialog() override;
- bool IsJavaScriptModalDialog() override;
- void Invalidate() override;
-
- // Callbacks from NativeDialog when the user accepts or cancels the dialog.
- void OnCancel(bool suppress_js_messages);
- void OnAccept(const base::string16& prompt_text, bool suppress_js_messages);
-
- // NOTE: This is only called under Views, and should be removed. Any critical
- // work should be done in OnCancel or OnAccept. See crbug.com/63732 for more.
- void OnClose();
-
- // Used only for testing. The dialog will use the given text when notifying
- // its delegate instead of whatever the UI reports.
- void SetOverridePromptText(const base::string16& prompt_text);
-
- // Accessors
- content::JavaScriptMessageType javascript_message_type() const {
- return javascript_message_type_;
- }
- base::string16 message_text() const { return message_text_; }
- base::string16 default_prompt_text() const { return default_prompt_text_; }
- bool display_suppress_checkbox() const { return display_suppress_checkbox_; }
- bool is_before_unload_dialog() const { return is_before_unload_dialog_; }
- bool is_reload() const { return is_reload_; }
-
- private:
- // Notifies the delegate with the result of the dialog.
- void NotifyDelegate(bool success, const base::string16& prompt_text,
- bool suppress_js_messages);
-
- // A map of extra Chrome-only data associated with the delegate_.
- // Can be inspected via extra_data_map_[web_contents_].
- ExtraDataMap* extra_data_map_;
-
- // Information about the message box is held in the following variables.
- const content::JavaScriptMessageType javascript_message_type_;
- base::string16 message_text_;
- base::string16 default_prompt_text_;
- bool display_suppress_checkbox_;
- bool is_before_unload_dialog_;
- bool is_reload_;
-
- content::JavaScriptDialogManager::DialogClosedCallback callback_;
-
- // Used only for testing. Specifies alternative prompt text that should be
- // used when notifying the delegate, if |use_override_prompt_text_| is true.
- base::string16 override_prompt_text_;
- bool use_override_prompt_text_;
-
- DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialog);
-};
-
-#endif // COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_APP_MODAL_DIALOG_H_
« no previous file with comments | « components/app_modal_dialogs/app_modal_dialog_queue.cc ('k') | components/app_modal_dialogs/javascript_app_modal_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698