| 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/views/tab_modal_confirm_dialog_views.h" | 5 #include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 13 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" | 13 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" |
| 14 #include "chrome/browser/ui/views/constrained_window_views.h" | 14 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/views/controls/message_box_view.h" | 18 #include "ui/views/controls/message_box_view.h" |
| 19 #include "ui/views/window/dialog_client_view.h" | 19 #include "ui/views/window/dialog_client_view.h" |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 TabModalConfirmDialog* TabModalConfirmDialog::Create( | 22 TabModalConfirmDialog* TabModalConfirmDialog::Create( |
| 23 TabModalConfirmDialogDelegate* delegate, | 23 TabModalConfirmDialogDelegate* delegate, |
| 24 TabContents* tab_contents) { | 24 TabContents* tab_contents) { |
| 25 return new TabModalConfirmDialogViews(delegate, tab_contents); | 25 return new TabModalConfirmDialogViews(delegate, tab_contents); |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 const int kChromeStyleUniformInset = 0; | 29 const int kChromeStyleUniformInset = 0; |
| 30 const int kChromeStyleInterRowVerticalSpacing = 20; | 30 const int kChromeStyleInterRowVerticalSpacing = 32; |
| 31 | 31 |
| 32 const int kChromeStyleButtonVEdgeMargin = 0; | 32 const int kChromeStyleButtonVEdgeMargin = 0; |
| 33 const int kChromeStyleButtonHEdgeMargin = 0; | 33 const int kChromeStyleButtonHEdgeMargin = 0; |
| 34 const int kChromeStyleDialogButtonLabelSpacing = 24; | 34 const int kChromeStyleDialogButtonLabelSpacing = 24; |
| 35 | 35 |
| 36 views::MessageBoxView::InitParams CreateMessageBoxViewInitParams( | 36 views::MessageBoxView::InitParams CreateMessageBoxViewInitParams( |
| 37 const string16& message) | 37 const string16& message) |
| 38 { | 38 { |
| 39 views::MessageBoxView::InitParams params(message); | 39 views::MessageBoxView::InitParams params(message); |
| 40 | 40 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return message_box_view_->GetWidget(); | 130 return message_box_view_->GetWidget(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { | 133 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { |
| 134 return message_box_view_->GetWidget(); | 134 return message_box_view_->GetWidget(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void TabModalConfirmDialogViews::DeleteDelegate() { | 137 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 138 delete this; | 138 delete this; |
| 139 } | 139 } |
| OLD | NEW |