Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/automation/automation_util.cc

Issue 11246003: Remove Profile->GetExtensionProcessManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix extension_crash_recovery_browsertest Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
15 #include "base/synchronization/waitable_event.h" 15 #include "base/synchronization/waitable_event.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "chrome/browser/automation/automation_provider.h" 18 #include "chrome/browser/automation/automation_provider.h"
19 #include "chrome/browser/automation/automation_provider_json.h" 19 #include "chrome/browser/automation/automation_provider_json.h"
20 #include "chrome/browser/extensions/extension_process_manager.h" 20 #include "chrome/browser/extensions/extension_process_manager.h"
21 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_system.h"
22 #include "chrome/browser/printing/print_preview_tab_controller.h" 23 #include "chrome/browser/printing/print_preview_tab_controller.h"
23 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/sessions/session_id.h" 25 #include "chrome/browser/sessions/session_id.h"
25 #include "chrome/browser/sessions/session_tab_helper.h" 26 #include "chrome/browser/sessions/session_tab_helper.h"
26 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 27 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
27 #include "chrome/browser/ui/browser.h" 28 #include "chrome/browser/ui/browser.h"
28 #include "chrome/browser/ui/browser_list.h" 29 #include "chrome/browser/ui/browser_list.h"
29 #include "chrome/browser/ui/browser_tabstrip.h" 30 #include "chrome/browser/ui/browser_tabstrip.h"
30 #include "chrome/browser/ui/tab_contents/tab_contents.h" 31 #include "chrome/browser/ui/tab_contents/tab_contents.h"
31 #include "chrome/browser/view_type_utils.h" 32 #include "chrome/browser/view_type_utils.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 return false; 540 return false;
540 } 541 }
541 542
542 namespace { 543 namespace {
543 544
544 bool GetExtensionRenderViewForId( 545 bool GetExtensionRenderViewForId(
545 const AutomationId& id, 546 const AutomationId& id,
546 Profile* profile, 547 Profile* profile,
547 RenderViewHost** rvh) { 548 RenderViewHost** rvh) {
548 ExtensionProcessManager* extension_mgr = 549 ExtensionProcessManager* extension_mgr =
549 profile->GetExtensionProcessManager(); 550 extensions::ExtensionSystem::Get(profile)->process_manager();
550 const ExtensionProcessManager::ViewSet view_set = 551 const ExtensionProcessManager::ViewSet view_set =
551 extension_mgr->GetAllViews(); 552 extension_mgr->GetAllViews();
552 for (ExtensionProcessManager::ViewSet::const_iterator iter = view_set.begin(); 553 for (ExtensionProcessManager::ViewSet::const_iterator iter = view_set.begin();
553 iter != view_set.end(); ++iter) { 554 iter != view_set.end(); ++iter) {
554 content::RenderViewHost* host = *iter; 555 content::RenderViewHost* host = *iter;
555 AutomationId this_id = GetIdForExtensionView(host); 556 AutomationId this_id = GetIdForExtensionView(host);
556 if (id == this_id) { 557 if (id == this_id) {
557 *rvh = host; 558 *rvh = host;
558 return true; 559 return true;
559 } 560 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 const extensions::Extension* extension; 620 const extensions::Extension* extension;
620 return GetExtensionForId(id, profile, &extension); 621 return GetExtensionForId(id, profile, &extension);
621 } 622 }
622 default: 623 default:
623 break; 624 break;
624 } 625 }
625 return false; 626 return false;
626 } 627 }
627 628
628 } // namespace automation_util 629 } // namespace automation_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698