| 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_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // the buttons have no stock icons. | 71 // the buttons have no stock icons. |
| 72 virtual const char* GetAcceptButtonIcon(); | 72 virtual const char* GetAcceptButtonIcon(); |
| 73 virtual const char* GetCancelButtonIcon(); | 73 virtual const char* GetCancelButtonIcon(); |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 TabModalConfirmDialogCloseDelegate* close_delegate() { | 76 TabModalConfirmDialogCloseDelegate* close_delegate() { |
| 77 return close_delegate_; | 77 return close_delegate_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 // content::NotificationObserver implementation. | 80 // content::NotificationObserver implementation. |
| 81 // Watch for a new load or a closed tab and dismiss the dialog if they occur. | 81 // Watch for a closed tab and dismiss the dialog if it occurs. |
| 82 virtual void Observe(int type, | 82 virtual void Observe(int type, |
| 83 const content::NotificationSource& source, | 83 const content::NotificationSource& source, |
| 84 const content::NotificationDetails& details) OVERRIDE; | 84 const content::NotificationDetails& details) OVERRIDE; |
| 85 | 85 |
| 86 content::NotificationRegistrar registrar_; | 86 content::NotificationRegistrar registrar_; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 // Called when the user accepts or cancels the dialog, respectively. | 89 // Called when the user accepts or cancels the dialog, respectively. |
| 90 virtual void OnAccepted(); | 90 virtual void OnAccepted(); |
| 91 virtual void OnCanceled(); | 91 virtual void OnCanceled(); |
| 92 | 92 |
| 93 // Close the dialog. | 93 // Close the dialog. |
| 94 void CloseDialog(); | 94 void CloseDialog(); |
| 95 | 95 |
| 96 TabModalConfirmDialogCloseDelegate* close_delegate_; | 96 TabModalConfirmDialogCloseDelegate* close_delegate_; |
| 97 // True iff we are in the process of closing, to avoid running callbacks | 97 // True iff we are in the process of closing, to avoid running callbacks |
| 98 // multiple times. | 98 // multiple times. |
| 99 bool closing_; | 99 bool closing_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogDelegate); | 101 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogDelegate); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ | 104 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_ |
| OLD | NEW |