| 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/external_install_ui.h" | 5 #include "chrome/browser/extensions/external_install_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 if (!extension) | 164 if (!extension) |
| 165 return; | 165 return; |
| 166 GlobalErrorService* error_service = | 166 GlobalErrorService* error_service = |
| 167 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 167 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
| 168 if (error_service->GetGlobalErrorByMenuItemCommandID(kMenuCommandId)) | 168 if (error_service->GetGlobalErrorByMenuItemCommandID(kMenuCommandId)) |
| 169 return; | 169 return; |
| 170 | 170 |
| 171 ExternalInstallDialogDelegate* delegate = | 171 ExternalInstallDialogDelegate* delegate = |
| 172 static_cast<ExternalInstallDialogDelegate*>(prompt_delegate); | 172 static_cast<ExternalInstallDialogDelegate*>(prompt_delegate); |
| 173 ExternalInstallGlobalError* error_bubble = new ExternalInstallGlobalError( | 173 ExternalInstallGlobalError* error_bubble = new ExternalInstallGlobalError( |
| 174 service, extension, delegate, prompt); | 174 service.get(), extension, delegate, prompt); |
| 175 error_service->AddGlobalError(error_bubble); | 175 error_service->AddGlobalError(error_bubble); |
| 176 // Show bubble immediately if possible. | 176 // Show bubble immediately if possible. |
| 177 if (delegate->browser()) | 177 if (delegate->browser()) |
| 178 error_bubble->ShowBubbleView(delegate->browser()); | 178 error_bubble->ShowBubbleView(delegate->browser()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 static void ShowExternalInstallDialog( | 181 static void ShowExternalInstallDialog( |
| 182 ExtensionService* service, | 182 ExtensionService* service, |
| 183 Browser* browser, | 183 Browser* browser, |
| 184 const Extension* extension) { | 184 const Extension* extension) { |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 444 |
| 445 bool HasExternalInstallBubble(ExtensionService* service) { | 445 bool HasExternalInstallBubble(ExtensionService* service) { |
| 446 GlobalErrorService* error_service = | 446 GlobalErrorService* error_service = |
| 447 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 447 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
| 448 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( | 448 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( |
| 449 kMenuCommandId); | 449 kMenuCommandId); |
| 450 return error && error->HasBubbleView(); | 450 return error && error->HasBubbleView(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace extensions | 453 } // namespace extensions |
| OLD | NEW |