| 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_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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 void AddExternalInstallError(ExtensionService* service, | 542 void AddExternalInstallError(ExtensionService* service, |
| 543 const Extension* extension, | 543 const Extension* extension, |
| 544 bool is_new_profile) { | 544 bool is_new_profile) { |
| 545 GlobalErrorService* error_service = | 545 GlobalErrorService* error_service = |
| 546 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 546 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
| 547 if (error_service->GetGlobalErrorByMenuItemCommandID(kMenuCommandId)) | 547 if (error_service->GetGlobalErrorByMenuItemCommandID(kMenuCommandId)) |
| 548 return; | 548 return; |
| 549 | 549 |
| 550 if (UseBubbleInstall(extension, is_new_profile)) { | 550 if (UseBubbleInstall(extension, is_new_profile)) { |
| 551 Browser* browser = NULL; | 551 Browser* browser = NULL; |
| 552 #if !defined(OS_ANDROID) | |
| 553 browser = chrome::FindTabbedBrowser(service->profile(), | 552 browser = chrome::FindTabbedBrowser(service->profile(), |
| 554 true, | 553 true, |
| 555 chrome::GetActiveDesktop()); | 554 chrome::GetActiveDesktop()); |
| 556 #endif | |
| 557 new ExternalInstallDialogDelegate(browser, service, extension, true); | 555 new ExternalInstallDialogDelegate(browser, service, extension, true); |
| 558 } else { | 556 } else { |
| 559 error_service->AddGlobalError( | 557 error_service->AddGlobalError( |
| 560 new ExternalInstallMenuAlert(service, extension)); | 558 new ExternalInstallMenuAlert(service, extension)); |
| 561 } | 559 } |
| 562 } | 560 } |
| 563 | 561 |
| 564 void RemoveExternalInstallError(ExtensionService* service) { | 562 void RemoveExternalInstallError(ExtensionService* service) { |
| 565 GlobalErrorService* error_service = | 563 GlobalErrorService* error_service = |
| 566 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 564 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 582 | 580 |
| 583 bool HasExternalInstallBubble(ExtensionService* service) { | 581 bool HasExternalInstallBubble(ExtensionService* service) { |
| 584 GlobalErrorService* error_service = | 582 GlobalErrorService* error_service = |
| 585 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 583 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
| 586 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( | 584 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( |
| 587 kMenuCommandId); | 585 kMenuCommandId); |
| 588 return error && error->HasBubbleView(); | 586 return error && error->HasBubbleView(); |
| 589 } | 587 } |
| 590 | 588 |
| 591 } // namespace extensions | 589 } // namespace extensions |
| OLD | NEW |