| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: | 423 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: |
| 424 type = AutomationId::kTypeExtensionInfobar; | 424 type = AutomationId::kTypeExtensionInfobar; |
| 425 break; | 425 break; |
| 426 default: | 426 default: |
| 427 type = AutomationId::kTypeInvalid; | 427 type = AutomationId::kTypeInvalid; |
| 428 break; | 428 break; |
| 429 } | 429 } |
| 430 // Since these extension views do not permit navigation, using the | 430 // Since these extension views do not permit navigation, using the |
| 431 // renderer process and view ID should suffice. | 431 // renderer process and view ID should suffice. |
| 432 std::string id = base::StringPrintf("%d|%d", | 432 std::string id = base::StringPrintf("%d|%d", |
| 433 ext_host->render_view_host()->routing_id(), | 433 ext_host->render_view_host()->GetRoutingID(), |
| 434 ext_host->render_process_host()->GetID()); | 434 ext_host->render_process_host()->GetID()); |
| 435 return AutomationId(type, id); | 435 return AutomationId(type, id); |
| 436 } | 436 } |
| 437 | 437 |
| 438 AutomationId GetIdForExtension(const Extension* extension) { | 438 AutomationId GetIdForExtension(const Extension* extension) { |
| 439 return AutomationId(AutomationId::kTypeExtension, extension->id()); | 439 return AutomationId(AutomationId::kTypeExtension, extension->id()); |
| 440 } | 440 } |
| 441 | 441 |
| 442 bool GetTabForId(const AutomationId& id, WebContents** tab) { | 442 bool GetTabForId(const AutomationId& id, WebContents** tab) { |
| 443 if (id.type() != AutomationId::kTypeTab) | 443 if (id.type() != AutomationId::kTypeTab) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 const Extension* extension; | 535 const Extension* extension; |
| 536 return GetExtensionForId(id, profile, &extension); | 536 return GetExtensionForId(id, profile, &extension); |
| 537 } | 537 } |
| 538 default: | 538 default: |
| 539 break; | 539 break; |
| 540 } | 540 } |
| 541 return false; | 541 return false; |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace automation_util | 544 } // namespace automation_util |
| OLD | NEW |