| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 85 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 86 int GetDefaultDialogButton() const override { | 86 int GetDefaultDialogButton() const override { |
| 87 // Default to accept when triggered via chrome://extensions page. | 87 // Default to accept when triggered via chrome://extensions page. |
| 88 return triggered_by_extension_ ? | 88 return triggered_by_extension_ ? |
| 89 ui::DIALOG_BUTTON_CANCEL : ui::DIALOG_BUTTON_OK; | 89 ui::DIALOG_BUTTON_CANCEL : ui::DIALOG_BUTTON_OK; |
| 90 } | 90 } |
| 91 bool Accept() override; | 91 bool Accept() override; |
| 92 bool Cancel() override; | 92 bool Cancel() override; |
| 93 | 93 |
| 94 // views::WidgetDelegate: | 94 // views::WidgetDelegate: |
| 95 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_WINDOW; } | 95 ui::ModalType GetModalType() const override { |
| 96 #if 0 && defined(OS_MACOSX) |
| 97 // Use Tab-Modal on Mac (window-modal uses a "sheet"). |
| 98 return ui::MODAL_TYPE_CHILD; |
| 99 #else |
| 100 return ui::MODAL_TYPE_WINDOW; |
| 101 #endif |
| 102 } |
| 96 base::string16 GetWindowTitle() const override; | 103 base::string16 GetWindowTitle() const override; |
| 97 | 104 |
| 98 // views::View: | 105 // views::View: |
| 99 gfx::Size GetPreferredSize() const override; | 106 gfx::Size GetPreferredSize() const override; |
| 100 | 107 |
| 101 void Layout() override; | 108 void Layout() override; |
| 102 | 109 |
| 103 ExtensionUninstallDialogViews* dialog_; | 110 ExtensionUninstallDialogViews* dialog_; |
| 104 | 111 |
| 105 views::ImageView* icon_; | 112 views::ImageView* icon_; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 286 |
| 280 } // namespace | 287 } // namespace |
| 281 | 288 |
| 282 // static | 289 // static |
| 283 extensions::ExtensionUninstallDialog* | 290 extensions::ExtensionUninstallDialog* |
| 284 extensions::ExtensionUninstallDialog::Create(Profile* profile, | 291 extensions::ExtensionUninstallDialog::Create(Profile* profile, |
| 285 gfx::NativeWindow parent, | 292 gfx::NativeWindow parent, |
| 286 Delegate* delegate) { | 293 Delegate* delegate) { |
| 287 return new ExtensionUninstallDialogViews(profile, parent, delegate); | 294 return new ExtensionUninstallDialogViews(profile, parent, delegate); |
| 288 } | 295 } |
| OLD | NEW |