OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/network_delegate.h" | 5 #include "mojo/shell/network_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | |
8 #include "mojo/shell/switches.h" | |
9 #include "net/url_request/url_request.h" | 7 #include "net/url_request/url_request.h" |
10 | 8 |
11 namespace mojo { | 9 namespace mojo { |
12 namespace shell { | 10 namespace shell { |
13 | 11 |
14 NetworkDelegate::NetworkDelegate() { | 12 NetworkDelegate::NetworkDelegate() { |
15 DetachFromThread(); | 13 DetachFromThread(); |
16 } | 14 } |
17 | 15 |
18 bool NetworkDelegate::OnCanAccessFile(const net::URLRequest& request, | 16 bool NetworkDelegate::OnCanAccessFile(const net::URLRequest& request, |
19 const base::FilePath& path) const { | 17 const base::FilePath& path) const { |
20 // TODO(aa): We might want to add a --allow-file-urls or something, but | 18 // TODO(davemoore): Implement. |
21 // starting conservative. | 19 return true; |
22 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kApp) | |
23 == request.url().spec(); | |
24 } | 20 } |
25 | 21 |
26 } // namespace shell | 22 } // namespace shell |
27 } // namespace mojo | 23 } // namespace mojo |
OLD | NEW |