| 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/automation/automation_util.h" | 5 #include "chrome/browser/automation/automation_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 } | 590 } |
| 591 return true; | 591 return true; |
| 592 } | 592 } |
| 593 | 593 |
| 594 bool GetExtensionForId( | 594 bool GetExtensionForId( |
| 595 const AutomationId& id, | 595 const AutomationId& id, |
| 596 Profile* profile, | 596 Profile* profile, |
| 597 const extensions::Extension** extension) { | 597 const extensions::Extension** extension) { |
| 598 if (id.type() != AutomationId::kTypeExtension) | 598 if (id.type() != AutomationId::kTypeExtension) |
| 599 return false; | 599 return false; |
| 600 ExtensionService* service = profile->GetExtensionService(); | 600 ExtensionService* service = extensions::ExtensionSystem::Get(profile)-> |
| 601 extension_service(); |
| 601 const extensions::Extension* installed_extension = | 602 const extensions::Extension* installed_extension = |
| 602 service->GetInstalledExtension(id.id()); | 603 service->GetInstalledExtension(id.id()); |
| 603 if (installed_extension) | 604 if (installed_extension) |
| 604 *extension = installed_extension; | 605 *extension = installed_extension; |
| 605 return !!installed_extension; | 606 return !!installed_extension; |
| 606 } | 607 } |
| 607 | 608 |
| 608 bool DoesObjectWithIdExist(const AutomationId& id, Profile* profile) { | 609 bool DoesObjectWithIdExist(const AutomationId& id, Profile* profile) { |
| 609 switch (id.type()) { | 610 switch (id.type()) { |
| 610 case AutomationId::kTypeTab: { | 611 case AutomationId::kTypeTab: { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 622 const extensions::Extension* extension; | 623 const extensions::Extension* extension; |
| 623 return GetExtensionForId(id, profile, &extension); | 624 return GetExtensionForId(id, profile, &extension); |
| 624 } | 625 } |
| 625 default: | 626 default: |
| 626 break; | 627 break; |
| 627 } | 628 } |
| 628 return false; | 629 return false; |
| 629 } | 630 } |
| 630 | 631 |
| 631 } // namespace automation_util | 632 } // namespace automation_util |
| OLD | NEW |