| 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 #ifndef CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ |
| 7 | 7 |
| 8 #if !(defined(USE_AURA) || defined(OS_CHROMEOS)) | 8 #if !(defined(USE_AURA) || defined(OS_CHROMEOS)) |
| 9 #error Tab-modal confirm dialog should be shown with native UI. | 9 #error Tab-modal confirm dialog should be shown with native UI. |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 15 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 16 #include "ui/web_dialogs/web_dialog_delegate.h" | 16 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 17 | 17 |
| 18 class ConstrainedWebDialogDelegate; | 18 class ConstrainedWebDialogDelegate; |
| 19 | 19 |
| 20 namespace content { |
| 21 class WebContents; |
| 22 } |
| 23 |
| 20 // Displays a tab-modal dialog, i.e. a dialog that will block the current page | 24 // Displays a tab-modal dialog, i.e. a dialog that will block the current page |
| 21 // but still allow the user to switch to a different page. | 25 // but still allow the user to switch to a different page. |
| 22 // To display the dialog, allocate this object on the heap. It will open the | 26 // To display the dialog, allocate this object on the heap. It will open the |
| 23 // dialog from its constructor and then delete itself when the user dismisses | 27 // dialog from its constructor and then delete itself when the user dismisses |
| 24 // the dialog. | 28 // the dialog. |
| 25 class TabModalConfirmDialogWebUI : public TabModalConfirmDialog, | 29 class TabModalConfirmDialogWebUI : public TabModalConfirmDialog, |
| 26 public ui::WebDialogDelegate { | 30 public ui::WebDialogDelegate { |
| 27 public: | 31 public: |
| 28 TabModalConfirmDialogWebUI( | 32 TabModalConfirmDialogWebUI( |
| 29 TabModalConfirmDialogDelegate* dialog_delegate, | 33 TabModalConfirmDialogDelegate* dialog_delegate, |
| 30 TabContents* tab_contents); | 34 content::WebContents* web_contents); |
| 31 | 35 |
| 32 // ui::WebDialogDelegate implementation. | 36 // ui::WebDialogDelegate implementation. |
| 33 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | 37 virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
| 34 virtual string16 GetDialogTitle() const OVERRIDE; | 38 virtual string16 GetDialogTitle() const OVERRIDE; |
| 35 virtual GURL GetDialogContentURL() const OVERRIDE; | 39 virtual GURL GetDialogContentURL() const OVERRIDE; |
| 36 virtual void GetWebUIMessageHandlers( | 40 virtual void GetWebUIMessageHandlers( |
| 37 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 41 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
| 38 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 42 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
| 39 virtual std::string GetDialogArgs() const OVERRIDE; | 43 virtual std::string GetDialogArgs() const OVERRIDE; |
| 40 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 44 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 55 | 59 |
| 56 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 60 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 57 | 61 |
| 58 // Deletes itself. | 62 // Deletes itself. |
| 59 ConstrainedWebDialogDelegate* constrained_web_dialog_delegate_; | 63 ConstrainedWebDialogDelegate* constrained_web_dialog_delegate_; |
| 60 | 64 |
| 61 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI); | 65 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 #endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ | 68 #endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ |
| OLD | NEW |