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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.cc

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 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
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/chromeos/file_manager/file_browser_handlers.h" 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 namespace file_manager { 54 namespace file_manager {
55 namespace file_browser_handlers { 55 namespace file_browser_handlers {
56 namespace { 56 namespace {
57 57
58 // Returns process id of the process the extension is running in. 58 // Returns process id of the process the extension is running in.
59 int ExtractProcessFromExtensionId(Profile* profile, 59 int ExtractProcessFromExtensionId(Profile* profile,
60 const std::string& extension_id) { 60 const std::string& extension_id) {
61 GURL extension_url = 61 GURL extension_url =
62 Extension::GetBaseURLFromExtensionId(extension_id); 62 Extension::GetBaseURLFromExtensionId(extension_id);
63 extensions::ProcessManager* manager = 63 extensions::ProcessManager* manager =
64 extensions::ExtensionSystem::Get(profile)->process_manager(); 64 extensions::ProcessManager::Get(profile);
65 65
66 SiteInstance* site_instance = manager->GetSiteInstanceForURL(extension_url); 66 SiteInstance* site_instance = manager->GetSiteInstanceForURL(extension_url);
67 if (!site_instance || !site_instance->HasProcess()) 67 if (!site_instance || !site_instance->HasProcess())
68 return -1; 68 return -1;
69 content::RenderProcessHost* process = site_instance->GetProcess(); 69 content::RenderProcessHost* process = site_instance->GetProcess();
70 70
71 return process->GetID(); 71 return process->GetID();
72 } 72 }
73 73
74 // Finds a file browser handler that matches |action_id|. Returns NULL if not 74 // Finds a file browser handler that matches |action_id|. Returns NULL if not
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 if (common_handlers.empty()) 517 if (common_handlers.empty())
518 return FileBrowserHandlerList(); 518 return FileBrowserHandlerList();
519 } 519 }
520 } 520 }
521 521
522 return common_handlers; 522 return common_handlers;
523 } 523 }
524 524
525 } // namespace file_browser_handlers 525 } // namespace file_browser_handlers
526 } // namespace file_manager 526 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698