Commit 54e0ee69 authored by jam@chromium.org's avatar jam@chromium.org

Move kChromeSearchScheme out of content since it's a chrome feature.

Also remove ContentBrowserClient::RenderProcessHostDeleted since it duplicates an existing notification.
Review URL: https://codereview.chromium.org/12087129

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180150 0039d316-1c4b-4281-b951-d872f2087c98
parent da3c6219
......@@ -720,18 +720,6 @@ void ChromeContentBrowserClient::RenderProcessHostCreated(
host->Send(new ChromeViewMsg_SetContentSettingRules(rules));
}
void ChromeContentBrowserClient::RenderProcessHostDeleted(
content::RenderProcessHost* host) {
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
if (!profile)
return;
InstantService* instant_service =
InstantServiceFactory::GetForProfile(profile);
if (instant_service)
instant_service->RemoveInstantProcess(host->GetID());
}
GURL ChromeContentBrowserClient::GetEffectiveURL(
content::BrowserContext* browser_context, const GURL& url) {
Profile* profile = Profile::FromBrowserContext(browser_context);
......
......@@ -64,8 +64,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
content::WebContents* embedder_web_contents) OVERRIDE;
virtual void RenderProcessHostCreated(
content::RenderProcessHost* host) OVERRIDE;
virtual void RenderProcessHostDeleted(
content::RenderProcessHost* host) OVERRIDE;
virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) OVERRIDE;
virtual GURL GetEffectiveURL(content::BrowserContext* browser_context,
......
......@@ -4,7 +4,14 @@
#include "chrome/browser/instant/instant_service.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
InstantService::InstantService() {
registrar_.Add(this,
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
content::NotificationService::AllSources());
}
InstantService::~InstantService() {
......@@ -14,10 +21,6 @@ void InstantService::AddInstantProcess(int process_id) {
process_ids_.insert(process_id);
}
void InstantService::RemoveInstantProcess(int process_id) {
process_ids_.erase(process_id);
}
bool InstantService::IsInstantProcess(int process_id) const {
return process_ids_.count(process_id) != 0;
}
......@@ -29,3 +32,10 @@ int InstantService::GetInstantProcessCount() const {
void InstantService::Shutdown() {
process_ids_.clear();
}
void InstantService::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
int process_id = content::Source<content::RenderProcessHost>(source)->GetID();
process_ids_.erase(process_id);
}
......@@ -10,9 +10,12 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
// Tracks render process host ids that are associated with Instant.
class InstantService : public ProfileKeyedService {
class InstantService : public ProfileKeyedService,
public content::NotificationObserver {
public:
InstantService();
virtual ~InstantService();
......@@ -20,7 +23,6 @@ class InstantService : public ProfileKeyedService {
// Add, remove, and query RenderProcessHost IDs that are associated with
// Instant processes.
void AddInstantProcess(int process_id);
void RemoveInstantProcess(int process_id);
bool IsInstantProcess(int process_id) const;
// For testing.
......@@ -30,9 +32,15 @@ class InstantService : public ProfileKeyedService {
// ProfileKeyedService:
virtual void Shutdown() OVERRIDE;
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
// The process ids associated with Instant processes.
std::set<int> process_ids_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(InstantService);
};
......
......@@ -381,6 +381,7 @@ void ChromeContentClient::AddAdditionalSchemes(
savable_schemes->push_back(extensions::kExtensionScheme);
standard_schemes->push_back(kExtensionResourceScheme);
savable_schemes->push_back(kExtensionResourceScheme);
standard_schemes->push_back(chrome::kChromeSearchScheme);
#if defined(OS_CHROMEOS)
standard_schemes->push_back(kCrosScheme);
#endif
......
......@@ -508,6 +508,8 @@ const int kNumberOfChromeDebugURLs =
const char kExtensionResourceScheme[] = "chrome-extension-resource";
const char kChromeSearchScheme[] = "chrome-search";
// Google SafeSearch query parameters.
const char kSafeSearchSafeParameter[] = "safe=active";
const char kSafeSearchSsuiParameter[] = "ssui=on";
......
......@@ -393,9 +393,7 @@ extern const char kSideloadWipeoutHelpURL[];
#if defined(OS_CHROMEOS)
// The URL for the "Learn more" link for natural scrolling on ChromeOS.
extern const char kNaturalScrollHelpURL[];
#endif
#if defined(OS_CHROMEOS)
// The URL for the Learn More page about enterprise enrolled devices.
extern const char kLearnMoreEnterpriseURL[];
#endif
......@@ -407,11 +405,12 @@ extern const int kNumberOfChromeDebugURLs;
// Canonical schemes you can use as input to GURL.SchemeIs().
extern const char kExtensionResourceScheme[];
extern const char kChromeSearchScheme[];
#if defined(OS_CHROMEOS)
extern const char kCrosScheme[];
extern const char kDriveScheme[];
#endif
#if defined(OS_CHROMEOS)
// "Learn more" URL for the Cloud Print section under Options.
extern const char kCloudPrintLearnMoreURL[];
#endif
......
......@@ -1161,8 +1161,6 @@ void RenderProcessHostImpl::Cleanup() {
Source<RenderProcessHost>(this),
NotificationService::NoDetails());
GetContentClient()->browser()->RenderProcessHostDeleted(this);
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
deleting_soon_ = true;
// It's important not to wait for the DeleteTask to delete the channel
......
......@@ -37,7 +37,6 @@ void RegisterContentSchemes(bool lock_standard_schemes) {
// Don't need "chrome-internal" which was used in old versions of Chrome for
// the new tab page.
url_util::AddStandardScheme(chrome::kChromeDevToolsScheme);
url_util::AddStandardScheme(chrome::kChromeSearchScheme);
url_util::AddStandardScheme(chrome::kChromeUIScheme);
url_util::AddStandardScheme(chrome::kMetadataScheme);
url_util::AddStandardScheme(chrome::kGuestScheme);
......
......@@ -119,9 +119,6 @@ class CONTENT_EXPORT ContentBrowserClient {
// embedder's IPC filters have priority.
virtual void RenderProcessHostCreated(RenderProcessHost* host) {}
// Notifies that a RenderProcessHost is about to be deleted.
virtual void RenderProcessHostDeleted(RenderProcessHost* host) {}
// Notifies that a BrowserChildProcessHost has been created.
virtual void BrowserChildProcessHostCreated(BrowserChildProcessHost* host) {}
......
......@@ -16,7 +16,6 @@ const char kBlobScheme[] = "blob";
// There are security implications associated with introducing new schemes.
const char kChromeDevToolsScheme[] = "chrome-devtools";
const char kChromeInternalScheme[] = "chrome-internal";
const char kChromeSearchScheme[] = "chrome-search";
const char kChromeUIScheme[] = "chrome";
const char kDataScheme[] = "data";
const char kFileScheme[] = "file";
......
......@@ -21,9 +21,7 @@ CONTENT_EXPORT extern const char kAboutScheme[];
CONTENT_EXPORT extern const char kBlobScheme[];
CONTENT_EXPORT extern const char kChromeDevToolsScheme[];
CONTENT_EXPORT extern const char kChromeInternalScheme[];
CONTENT_EXPORT extern const char kChromeSearchScheme[];
CONTENT_EXPORT extern const char kChromeUIScheme[]; // Used for WebUIs.
CONTENT_EXPORT extern const char kCrosScheme[]; // Used for ChromeOS.
CONTENT_EXPORT extern const char kDataScheme[];
CONTENT_EXPORT extern const char kFileScheme[];
CONTENT_EXPORT extern const char kFileSystemScheme[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment