| 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_VIEWS_UNINSTALL_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/callback.h" |
| 11 #include "base/string16.h" | 12 #include "base/string16.h" |
| 12 #include "ui/base/models/combobox_model.h" | 13 #include "ui/base/models/combobox_model.h" |
| 13 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
| 14 | 15 |
| 15 namespace views { | 16 namespace views { |
| 16 class Checkbox; | 17 class Checkbox; |
| 17 class Combobox; | 18 class Combobox; |
| 18 class Label; | 19 class Label; |
| 19 } | 20 } |
| 20 | 21 |
| 21 // UninstallView implements the dialog that confirms Chrome uninstallation | 22 // UninstallView implements the dialog that confirms Chrome uninstallation |
| 22 // and asks whether to delete Chrome profile. Also if currently Chrome is set | 23 // and asks whether to delete Chrome profile. Also if currently Chrome is set |
| 23 // as default browser, it asks users whether to set another browser as default. | 24 // as default browser, it asks users whether to set another browser as default. |
| 24 class UninstallView : public views::ButtonListener, | 25 class UninstallView : public views::ButtonListener, |
| 25 public views::DialogDelegateView, | 26 public views::DialogDelegateView, |
| 26 public ui::ComboboxModel { | 27 public ui::ComboboxModel { |
| 27 public: | 28 public: |
| 28 explicit UninstallView(int* user_selection); | 29 explicit UninstallView(int* user_selection, |
| 30 const base::Closure& quit_closure); |
| 29 virtual ~UninstallView(); | 31 virtual ~UninstallView(); |
| 30 | 32 |
| 31 // Overridden form views::ButtonListener. | 33 // Overridden form views::ButtonListener. |
| 32 virtual void ButtonPressed(views::Button* sender, | 34 virtual void ButtonPressed(views::Button* sender, |
| 33 const views::Event& event) OVERRIDE; | 35 const views::Event& event) OVERRIDE; |
| 34 | 36 |
| 35 // Overridden from views::DialogDelegateView: | 37 // Overridden from views::DialogDelegateView: |
| 36 virtual bool Accept() OVERRIDE; | 38 virtual bool Accept() OVERRIDE; |
| 37 virtual bool Cancel() OVERRIDE; | 39 virtual bool Cancel() OVERRIDE; |
| 38 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 40 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 // Initializes the controls on the dialog. | 51 // Initializes the controls on the dialog. |
| 50 void SetupControls(); | 52 void SetupControls(); |
| 51 | 53 |
| 52 views::Label* confirm_label_; | 54 views::Label* confirm_label_; |
| 53 views::Checkbox* delete_profile_; | 55 views::Checkbox* delete_profile_; |
| 54 views::Checkbox* change_default_browser_; | 56 views::Checkbox* change_default_browser_; |
| 55 views::Combobox* browsers_combo_; | 57 views::Combobox* browsers_combo_; |
| 56 typedef std::map<std::wstring, std::wstring> BrowsersMap; | 58 typedef std::map<std::wstring, std::wstring> BrowsersMap; |
| 57 scoped_ptr<BrowsersMap> browsers_; | 59 scoped_ptr<BrowsersMap> browsers_; |
| 58 int& user_selection_; | 60 int& user_selection_; |
| 61 base::Closure quit_closure_; |
| 59 | 62 |
| 60 DISALLOW_COPY_AND_ASSIGN(UninstallView); | 63 DISALLOW_COPY_AND_ASSIGN(UninstallView); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 #endif // CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ |
| OLD | NEW |