mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Branch CEF3 files from /branches/cef3 to /trunk/cef3 (issue #564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@571 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
		
							
								
								
									
										50
									
								
								libcef/browser/devtools_delegate.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								libcef/browser/devtools_delegate.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 | 
			
		||||
// Use of this source code is governed by a BSD-style license that can be
 | 
			
		||||
// found in the LICENSE file.
 | 
			
		||||
 | 
			
		||||
#include "libcef/browser/devtools_delegate.h"
 | 
			
		||||
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
 | 
			
		||||
#include "content/public/browser/devtools_http_handler.h"
 | 
			
		||||
#include "content/public/common/content_client.h"
 | 
			
		||||
#include "grit/cef_resources.h"
 | 
			
		||||
#include "net/url_request/url_request_context_getter.h"
 | 
			
		||||
#include "ui/base/resource/resource_bundle.h"
 | 
			
		||||
 | 
			
		||||
CefDevToolsDelegate::CefDevToolsDelegate(
 | 
			
		||||
    int port,
 | 
			
		||||
    net::URLRequestContextGetter* context_getter)
 | 
			
		||||
    : context_getter_(context_getter) {
 | 
			
		||||
  devtools_http_handler_ = content::DevToolsHttpHandler::Start(
 | 
			
		||||
      "127.0.0.1",
 | 
			
		||||
      port,
 | 
			
		||||
      "",
 | 
			
		||||
      this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CefDevToolsDelegate::~CefDevToolsDelegate() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CefDevToolsDelegate::Stop() {
 | 
			
		||||
  // The call below destroys this.
 | 
			
		||||
  devtools_http_handler_->Stop();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {
 | 
			
		||||
  return content::GetContentClient()->GetDataResource(
 | 
			
		||||
      IDR_CEF_DEVTOOLS_DISCOVERY_PAGE).as_string();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
net::URLRequestContext*
 | 
			
		||||
CefDevToolsDelegate::GetURLRequestContext() {
 | 
			
		||||
  return context_getter_->GetURLRequestContext();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool CefDevToolsDelegate::BundlesFrontendResources() {
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::string CefDevToolsDelegate::GetFrontendResourcesBaseURL() {
 | 
			
		||||
  return "";
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user