| 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_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // When the native dialog is closed, the implementation of | 49 // When the native dialog is closed, the implementation of |
| 50 // NativeAppModalDialog should call OnAccept or OnCancel to notify the | 50 // NativeAppModalDialog should call OnAccept or OnCancel to notify the |
| 51 // renderer of the user's action. The NativeAppModalDialog is also | 51 // renderer of the user's action. The NativeAppModalDialog is also |
| 52 // expected to delete the AppModalDialog associated with it. | 52 // expected to delete the AppModalDialog associated with it. |
| 53 virtual void CreateAndShowDialog(); | 53 virtual void CreateAndShowDialog(); |
| 54 | 54 |
| 55 // Returns true if the dialog is still valid. As dialogs are created they are | 55 // Returns true if the dialog is still valid. As dialogs are created they are |
| 56 // added to the AppModalDialogQueue. When the current modal dialog finishes | 56 // added to the AppModalDialogQueue. When the current modal dialog finishes |
| 57 // and it's time to show the next dialog in the queue IsValid is invoked. | 57 // and it's time to show the next dialog in the queue IsValid is invoked. |
| 58 // If IsValid returns false the dialog is deleted and not shown. | 58 // If IsValid returns false the dialog is deleted and not shown. |
| 59 virtual bool IsValid() { return !skip_this_dialog_; } | 59 virtual bool IsValid(); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 // Overridden by subclasses to create the feature-specific native dialog box. | 62 // Overridden by subclasses to create the feature-specific native dialog box. |
| 63 virtual NativeAppModalDialog* CreateNativeDialog() = 0; | 63 virtual NativeAppModalDialog* CreateNativeDialog() = 0; |
| 64 | 64 |
| 65 // True if the dialog should no longer be shown, e.g. because the underlying | 65 // True if the dialog should no longer be shown, e.g. because the underlying |
| 66 // tab navigated away while the dialog was queued. | 66 // tab navigated away while the dialog was queued. |
| 67 bool skip_this_dialog_; | 67 bool skip_this_dialog_; |
| 68 | 68 |
| 69 // Parent tab contents. | 69 // Parent tab contents. |
| 70 TabContents* tab_contents_; | 70 TabContents* tab_contents_; |
| 71 | 71 |
| 72 // The toolkit-specific implementation of the app modal dialog box. | 72 // The toolkit-specific implementation of the app modal dialog box. |
| 73 NativeAppModalDialog* native_dialog_; | 73 NativeAppModalDialog* native_dialog_; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // Information about the message box is held in the following variables. | 76 // Information about the message box is held in the following variables. |
| 77 std::wstring title_; | 77 std::wstring title_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(AppModalDialog); | 79 DISALLOW_COPY_AND_ASSIGN(AppModalDialog); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ | 82 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_H_ |
| OLD | NEW |