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/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/saved_files_service.h" | 8 #include "apps/saved_files_service.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // This class is designed to broker the message between the two objects, while | 133 // This class is designed to broker the message between the two objects, while |
134 // managing its own lifetime so that it can outlive the ExtensionSettingsHandler | 134 // managing its own lifetime so that it can outlive the ExtensionSettingsHandler |
135 // and (when doing so) gracefully ignore the message from the dialog. | 135 // and (when doing so) gracefully ignore the message from the dialog. |
136 class BrokerDelegate : public ExtensionInstallPrompt::Delegate { | 136 class BrokerDelegate : public ExtensionInstallPrompt::Delegate { |
137 public: | 137 public: |
138 explicit BrokerDelegate( | 138 explicit BrokerDelegate( |
139 const base::WeakPtr<ExtensionSettingsHandler>& delegate) | 139 const base::WeakPtr<ExtensionSettingsHandler>& delegate) |
140 : delegate_(delegate) {} | 140 : delegate_(delegate) {} |
141 | 141 |
142 // ExtensionInstallPrompt::Delegate implementation. | 142 // ExtensionInstallPrompt::Delegate implementation. |
143 virtual void InstallUIProceed() override { | 143 void InstallUIProceed() override { |
144 if (delegate_) | 144 if (delegate_) |
145 delegate_->InstallUIProceed(); | 145 delegate_->InstallUIProceed(); |
146 delete this; | 146 delete this; |
147 }; | 147 }; |
148 | 148 |
149 virtual void InstallUIAbort(bool user_initiated) override { | 149 void InstallUIAbort(bool user_initiated) override { |
150 if (delegate_) | 150 if (delegate_) |
151 delegate_->InstallUIAbort(user_initiated); | 151 delegate_->InstallUIAbort(user_initiated); |
152 delete this; | 152 delete this; |
153 }; | 153 }; |
154 | 154 |
155 private: | 155 private: |
156 base::WeakPtr<ExtensionSettingsHandler> delegate_; | 156 base::WeakPtr<ExtensionSettingsHandler> delegate_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(BrokerDelegate); | 158 DISALLOW_COPY_AND_ASSIGN(BrokerDelegate); |
159 }; | 159 }; |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 extension_service_->EnableExtension(extension_id); | 1499 extension_service_->EnableExtension(extension_id); |
1500 } else { | 1500 } else { |
1501 ExtensionErrorReporter::GetInstance()->ReportError( | 1501 ExtensionErrorReporter::GetInstance()->ReportError( |
1502 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1502 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1503 true); // Be noisy. | 1503 true); // Be noisy. |
1504 } | 1504 } |
1505 requirements_checker_.reset(); | 1505 requirements_checker_.reset(); |
1506 } | 1506 } |
1507 | 1507 |
1508 } // namespace extensions | 1508 } // namespace extensions |
OLD | NEW |