use generated constants

This commit is contained in:
deepak1556 2015-05-21 11:07:25 +05:30
parent ea147c588f
commit 27c3727ddb
2 changed files with 10 additions and 7 deletions

View file

@ -72,6 +72,13 @@ net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
job_factory->SetProtocolHandler(
url::kWssScheme, new HttpProtocolHandler(url::kWssScheme));
auto host_resolver = url_request_context_getter()
->GetURLRequestContext()
->host_resolver();
job_factory->SetProtocolHandler(
url::kFtpScheme, new net::FtpProtocolHandler(
new net::FtpNetworkLayer(host_resolver)));
// Set up interceptors in the reverse order.
scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
content::URLRequestInterceptorScopedVector::reverse_iterator it;

View file

@ -17,6 +17,7 @@
#include "content/public/renderer/render_view.h"
#include "ipc/ipc_message_macros.h"
#include "net/base/net_module.h"
#include "net/grit/net_resources.h"
#include "third_party/WebKit/public/web/WebDraggableRegion.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.h"
@ -31,11 +32,6 @@ namespace atom {
namespace {
// A hack here:
// Copy from net/grit/net_resources.h of chromium repository
// since libchromiumcontent doesn't expose it.
const int kIDR_DIR_HEADER_HTML = 4000;
bool GetIPCObject(v8::Isolate* isolate,
v8::Handle<v8::Context> context,
v8::Handle<v8::Object>* ipc) {
@ -57,10 +53,10 @@ std::vector<v8::Handle<v8::Value>> ListValueToVector(
}
base::StringPiece NetResourceProvider(int key) {
if (key == kIDR_DIR_HEADER_HTML) {
if (key == IDR_DIR_HEADER_HTML) {
base::StringPiece html_data =
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
kIDR_DIR_HEADER_HTML);
IDR_DIR_HEADER_HTML);
return html_data;
}
return base::StringPiece();