OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/external_install_error.h" | 5 #include "chrome/browser/extensions/external_install_error.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 // A global error that spawns a dialog when the menu item is clicked. | 50 // A global error that spawns a dialog when the menu item is clicked. |
51 class ExternalInstallMenuAlert : public GlobalError { | 51 class ExternalInstallMenuAlert : public GlobalError { |
52 public: | 52 public: |
53 explicit ExternalInstallMenuAlert(ExternalInstallError* error); | 53 explicit ExternalInstallMenuAlert(ExternalInstallError* error); |
54 virtual ~ExternalInstallMenuAlert(); | 54 virtual ~ExternalInstallMenuAlert(); |
55 | 55 |
56 private: | 56 private: |
57 // GlobalError implementation. | 57 // GlobalError implementation. |
58 virtual Severity GetSeverity() OVERRIDE; | 58 virtual Severity GetSeverity() override; |
59 virtual bool HasMenuItem() OVERRIDE; | 59 virtual bool HasMenuItem() override; |
60 virtual int MenuItemCommandID() OVERRIDE; | 60 virtual int MenuItemCommandID() override; |
61 virtual base::string16 MenuItemLabel() OVERRIDE; | 61 virtual base::string16 MenuItemLabel() override; |
62 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; | 62 virtual void ExecuteMenuItem(Browser* browser) override; |
63 virtual bool HasBubbleView() OVERRIDE; | 63 virtual bool HasBubbleView() override; |
64 virtual bool HasShownBubbleView() OVERRIDE; | 64 virtual bool HasShownBubbleView() override; |
65 virtual void ShowBubbleView(Browser* browser) OVERRIDE; | 65 virtual void ShowBubbleView(Browser* browser) override; |
66 virtual GlobalErrorBubbleViewBase* GetBubbleView() OVERRIDE; | 66 virtual GlobalErrorBubbleViewBase* GetBubbleView() override; |
67 | 67 |
68 // The owning ExternalInstallError. | 68 // The owning ExternalInstallError. |
69 ExternalInstallError* error_; | 69 ExternalInstallError* error_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(ExternalInstallMenuAlert); | 71 DISALLOW_COPY_AND_ASSIGN(ExternalInstallMenuAlert); |
72 }; | 72 }; |
73 | 73 |
74 // A global error that spawns a bubble when the menu item is clicked. | 74 // A global error that spawns a bubble when the menu item is clicked. |
75 class ExternalInstallBubbleAlert : public GlobalErrorWithStandardBubble { | 75 class ExternalInstallBubbleAlert : public GlobalErrorWithStandardBubble { |
76 public: | 76 public: |
77 explicit ExternalInstallBubbleAlert(ExternalInstallError* error, | 77 explicit ExternalInstallBubbleAlert(ExternalInstallError* error, |
78 ExtensionInstallPrompt::Prompt* prompt); | 78 ExtensionInstallPrompt::Prompt* prompt); |
79 virtual ~ExternalInstallBubbleAlert(); | 79 virtual ~ExternalInstallBubbleAlert(); |
80 | 80 |
81 private: | 81 private: |
82 // GlobalError implementation. | 82 // GlobalError implementation. |
83 virtual Severity GetSeverity() OVERRIDE; | 83 virtual Severity GetSeverity() override; |
84 virtual bool HasMenuItem() OVERRIDE; | 84 virtual bool HasMenuItem() override; |
85 virtual int MenuItemCommandID() OVERRIDE; | 85 virtual int MenuItemCommandID() override; |
86 virtual base::string16 MenuItemLabel() OVERRIDE; | 86 virtual base::string16 MenuItemLabel() override; |
87 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; | 87 virtual void ExecuteMenuItem(Browser* browser) override; |
88 | 88 |
89 // GlobalErrorWithStandardBubble implementation. | 89 // GlobalErrorWithStandardBubble implementation. |
90 virtual gfx::Image GetBubbleViewIcon() OVERRIDE; | 90 virtual gfx::Image GetBubbleViewIcon() override; |
91 virtual base::string16 GetBubbleViewTitle() OVERRIDE; | 91 virtual base::string16 GetBubbleViewTitle() override; |
92 virtual std::vector<base::string16> GetBubbleViewMessages() OVERRIDE; | 92 virtual std::vector<base::string16> GetBubbleViewMessages() override; |
93 virtual base::string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; | 93 virtual base::string16 GetBubbleViewAcceptButtonLabel() override; |
94 virtual base::string16 GetBubbleViewCancelButtonLabel() OVERRIDE; | 94 virtual base::string16 GetBubbleViewCancelButtonLabel() override; |
95 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; | 95 virtual void OnBubbleViewDidClose(Browser* browser) override; |
96 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; | 96 virtual void BubbleViewAcceptButtonPressed(Browser* browser) override; |
97 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; | 97 virtual void BubbleViewCancelButtonPressed(Browser* browser) override; |
98 | 98 |
99 // The owning ExternalInstallError. | 99 // The owning ExternalInstallError. |
100 ExternalInstallError* error_; | 100 ExternalInstallError* error_; |
101 | 101 |
102 // The Prompt with all information, which we then use to populate the bubble. | 102 // The Prompt with all information, which we then use to populate the bubble. |
103 ExtensionInstallPrompt::Prompt* prompt_; | 103 ExtensionInstallPrompt::Prompt* prompt_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(ExternalInstallBubbleAlert); | 105 DISALLOW_COPY_AND_ASSIGN(ExternalInstallBubbleAlert); |
106 }; | 106 }; |
107 | 107 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 if (browser) | 395 if (browser) |
396 global_error_->ShowBubbleView(browser); | 396 global_error_->ShowBubbleView(browser); |
397 } else { | 397 } else { |
398 DCHECK(alert_type_ == MENU_ALERT); | 398 DCHECK(alert_type_ == MENU_ALERT); |
399 global_error_.reset(new ExternalInstallMenuAlert(this)); | 399 global_error_.reset(new ExternalInstallMenuAlert(this)); |
400 error_service_->AddGlobalError(global_error_.get()); | 400 error_service_->AddGlobalError(global_error_.get()); |
401 } | 401 } |
402 } | 402 } |
403 | 403 |
404 } // namespace extensions | 404 } // namespace extensions |
OLD | NEW |