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/extensions/extension_uninstall_dialog.h" | 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual bool Accept() OVERRIDE; | 91 virtual bool Accept() OVERRIDE; |
92 virtual bool Cancel() OVERRIDE; | 92 virtual bool Cancel() OVERRIDE; |
93 | 93 |
94 // views::WidgetDelegate: | 94 // views::WidgetDelegate: |
95 virtual ui::ModalType GetModalType() const OVERRIDE { | 95 virtual ui::ModalType GetModalType() const OVERRIDE { |
96 return ui::MODAL_TYPE_WINDOW; | 96 return ui::MODAL_TYPE_WINDOW; |
97 } | 97 } |
98 virtual base::string16 GetWindowTitle() const OVERRIDE; | 98 virtual base::string16 GetWindowTitle() const OVERRIDE; |
99 | 99 |
100 // views::View: | 100 // views::View: |
101 virtual gfx::Size GetPreferredSize() OVERRIDE; | 101 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
102 | 102 |
103 virtual void Layout() OVERRIDE; | 103 virtual void Layout() OVERRIDE; |
104 | 104 |
105 ExtensionUninstallDialogViews* dialog_; | 105 ExtensionUninstallDialogViews* dialog_; |
106 | 106 |
107 views::ImageView* icon_; | 107 views::ImageView* icon_; |
108 views::Label* heading_; | 108 views::Label* heading_; |
109 bool triggered_by_extension_; | 109 bool triggered_by_extension_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogDelegateView); | 111 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogDelegateView); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bool ExtensionUninstallDialogDelegateView::Cancel() { | 196 bool ExtensionUninstallDialogDelegateView::Cancel() { |
197 if (dialog_) | 197 if (dialog_) |
198 dialog_->ExtensionUninstallCanceled(); | 198 dialog_->ExtensionUninstallCanceled(); |
199 return true; | 199 return true; |
200 } | 200 } |
201 | 201 |
202 base::string16 ExtensionUninstallDialogDelegateView::GetWindowTitle() const { | 202 base::string16 ExtensionUninstallDialogDelegateView::GetWindowTitle() const { |
203 return l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE); | 203 return l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE); |
204 } | 204 } |
205 | 205 |
206 gfx::Size ExtensionUninstallDialogDelegateView::GetPreferredSize() { | 206 gfx::Size ExtensionUninstallDialogDelegateView::GetPreferredSize() const { |
207 int width = kRightColumnWidth; | 207 int width = kRightColumnWidth; |
208 width += kIconSize; | 208 width += kIconSize; |
209 width += views::kButtonHEdgeMarginNew * 2; | 209 width += views::kButtonHEdgeMarginNew * 2; |
210 width += views::kRelatedControlHorizontalSpacing; | 210 width += views::kRelatedControlHorizontalSpacing; |
211 | 211 |
212 int height = views::kPanelVertMargin * 2; | 212 int height = views::kPanelVertMargin * 2; |
213 height += heading_->GetHeightForWidth(kRightColumnWidth); | 213 height += heading_->GetHeightForWidth(kRightColumnWidth); |
214 | 214 |
215 return gfx::Size(width, | 215 return gfx::Size(width, |
216 std::max(height, kIconSize + views::kPanelVertMargin * 2)); | 216 std::max(height, kIconSize + views::kPanelVertMargin * 2)); |
(...skipping 27 matching lines...) Expand all Loading... |
244 | 244 |
245 } // namespace | 245 } // namespace |
246 | 246 |
247 // static | 247 // static |
248 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 248 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
249 Profile* profile, | 249 Profile* profile, |
250 Browser* browser, | 250 Browser* browser, |
251 Delegate* delegate) { | 251 Delegate* delegate) { |
252 return new ExtensionUninstallDialogViews(profile, browser, delegate); | 252 return new ExtensionUninstallDialogViews(profile, browser, delegate); |
253 } | 253 } |
OLD | NEW |