| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 9 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "app/message_box_flags.h" | |
| 14 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 13 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
| 14 #include "ui/base/message_box_flags.h" |
| 15 #include "views/window/dialog_delegate.h" | 15 #include "views/window/dialog_delegate.h" |
| 16 | 16 |
| 17 class MessageBoxView; | 17 class MessageBoxView; |
| 18 | 18 |
| 19 class JSModalDialogViews : public NativeAppModalDialog, | 19 class JSModalDialogViews : public NativeAppModalDialog, |
| 20 public views::DialogDelegate { | 20 public views::DialogDelegate { |
| 21 public: | 21 public: |
| 22 explicit JSModalDialogViews(JavaScriptAppModalDialog* parent); | 22 explicit JSModalDialogViews(JavaScriptAppModalDialog* parent); |
| 23 virtual ~JSModalDialogViews(); | 23 virtual ~JSModalDialogViews(); |
| 24 | 24 |
| 25 // Overridden from NativeAppModalDialog: | 25 // Overridden from NativeAppModalDialog: |
| 26 virtual int GetAppModalDialogButtons() const; | 26 virtual int GetAppModalDialogButtons() const; |
| 27 virtual void ShowAppModalDialog(); | 27 virtual void ShowAppModalDialog(); |
| 28 virtual void ActivateAppModalDialog(); | 28 virtual void ActivateAppModalDialog(); |
| 29 virtual void CloseAppModalDialog(); | 29 virtual void CloseAppModalDialog(); |
| 30 virtual void AcceptAppModalDialog(); | 30 virtual void AcceptAppModalDialog(); |
| 31 virtual void CancelAppModalDialog(); | 31 virtual void CancelAppModalDialog(); |
| 32 | 32 |
| 33 // Overridden from views::DialogDelegate: | 33 // Overridden from views::DialogDelegate: |
| 34 virtual int GetDefaultDialogButton() const; | 34 virtual int GetDefaultDialogButton() const; |
| 35 virtual int GetDialogButtons() const; | 35 virtual int GetDialogButtons() const; |
| 36 virtual std::wstring GetWindowTitle() const; | 36 virtual std::wstring GetWindowTitle() const; |
| 37 virtual void WindowClosing(); | 37 virtual void WindowClosing(); |
| 38 virtual void DeleteDelegate(); | 38 virtual void DeleteDelegate(); |
| 39 virtual bool Cancel(); | 39 virtual bool Cancel(); |
| 40 virtual bool Accept(); | 40 virtual bool Accept(); |
| 41 virtual std::wstring GetDialogButtonLabel( | 41 virtual std::wstring GetDialogButtonLabel( |
| 42 MessageBoxFlags::DialogButton button) const; | 42 ui::MessageBoxFlags::DialogButton button) const; |
| 43 | 43 |
| 44 // Overridden from views::WindowDelegate: | 44 // Overridden from views::WindowDelegate: |
| 45 virtual bool IsModal() const { return true; } | 45 virtual bool IsModal() const { return true; } |
| 46 virtual views::View* GetContentsView(); | 46 virtual views::View* GetContentsView(); |
| 47 virtual views::View* GetInitiallyFocusedView(); | 47 virtual views::View* GetInitiallyFocusedView(); |
| 48 virtual void OnClose(); | 48 virtual void OnClose(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // A pointer to the AppModalDialog that owns us. | 51 // A pointer to the AppModalDialog that owns us. |
| 52 JavaScriptAppModalDialog* parent_; | 52 JavaScriptAppModalDialog* parent_; |
| 53 | 53 |
| 54 // The message box view whose commands we handle. | 54 // The message box view whose commands we handle. |
| 55 MessageBoxView* message_box_view_; | 55 MessageBoxView* message_box_view_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(JSModalDialogViews); | 57 DISALLOW_COPY_AND_ASSIGN(JSModalDialogViews); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 #endif // CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_JS_MODAL_DIALOG_VIEWS_H_ |
| OLD | NEW |