| 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 #include "chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h" | 5 #include "chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "grit/browser_resources.h" | 25 #include "grit/browser_resources.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
| 30 #include "ui/web_dialogs/constrained_web_dialog_ui.h" | 30 #include "ui/web_dialogs/constrained_web_dialog_ui.h" |
| 31 | 31 |
| 32 using content::WebContents; | 32 using content::WebContents; |
| 33 using content::WebUIMessageHandler; | 33 using content::WebUIMessageHandler; |
| 34 | 34 |
| 35 namespace browser { | 35 namespace chrome { |
| 36 | 36 |
| 37 // Declared in browser_dialogs.h so others don't have to depend on our header. | 37 // Declared in browser_dialogs.h so others don't have to depend on our header. |
| 38 void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate, | 38 void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate, |
| 39 TabContents* tab_contents) { | 39 TabContents* tab_contents) { |
| 40 new TabModalConfirmDialogWebUI(delegate, tab_contents); | 40 new TabModalConfirmDialogWebUI(delegate, tab_contents); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace browser | 43 } // namespace chrome |
| 44 | 44 |
| 45 const int kDialogWidth = 400; | 45 const int kDialogWidth = 400; |
| 46 const int kDialogHeight = 120; | 46 const int kDialogHeight = 120; |
| 47 | 47 |
| 48 TabModalConfirmDialogWebUI::TabModalConfirmDialogWebUI( | 48 TabModalConfirmDialogWebUI::TabModalConfirmDialogWebUI( |
| 49 TabModalConfirmDialogDelegate* delegate, | 49 TabModalConfirmDialogDelegate* delegate, |
| 50 TabContents* tab_contents) | 50 TabContents* tab_contents) |
| 51 : delegate_(delegate) { | 51 : delegate_(delegate) { |
| 52 Profile* profile = tab_contents->profile(); | 52 Profile* profile = tab_contents->profile(); |
| 53 ChromeWebUIDataSource* data_source = | 53 ChromeWebUIDataSource* data_source = |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 delegate_->Cancel(); | 111 delegate_->Cancel(); |
| 112 delete this; | 112 delete this; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void TabModalConfirmDialogWebUI::OnCloseContents(WebContents* source, | 115 void TabModalConfirmDialogWebUI::OnCloseContents(WebContents* source, |
| 116 bool* out_close_dialog) {} | 116 bool* out_close_dialog) {} |
| 117 | 117 |
| 118 bool TabModalConfirmDialogWebUI::ShouldShowDialogTitle() const { | 118 bool TabModalConfirmDialogWebUI::ShouldShowDialogTitle() const { |
| 119 return true; | 119 return true; |
| 120 } | 120 } |
| OLD | NEW |