OLD | NEW |
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/ui/webui/devtools_ui.h" | 5 #include "chrome/browser/ui/webui/devtools_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if (EndsWith(filename, ".html", false)) { | 69 if (EndsWith(filename, ".html", false)) { |
70 return "text/html"; | 70 return "text/html"; |
71 } else if (EndsWith(filename, ".css", false)) { | 71 } else if (EndsWith(filename, ".css", false)) { |
72 return "text/css"; | 72 return "text/css"; |
73 } else if (EndsWith(filename, ".js", false)) { | 73 } else if (EndsWith(filename, ".js", false)) { |
74 return "application/javascript"; | 74 return "application/javascript"; |
75 } else if (EndsWith(filename, ".png", false)) { | 75 } else if (EndsWith(filename, ".png", false)) { |
76 return "image/png"; | 76 return "image/png"; |
77 } else if (EndsWith(filename, ".gif", false)) { | 77 } else if (EndsWith(filename, ".gif", false)) { |
78 return "image/gif"; | 78 return "image/gif"; |
| 79 } else if (EndsWith(filename, ".svg", false)) { |
| 80 return "image/svg+xml"; |
79 } else if (EndsWith(filename, ".manifest", false)) { | 81 } else if (EndsWith(filename, ".manifest", false)) { |
80 return "text/cache-manifest"; | 82 return "text/cache-manifest"; |
81 } | 83 } |
82 return "text/html"; | 84 return "text/html"; |
83 } | 85 } |
84 | 86 |
85 // An URLDataSource implementation that handles chrome-devtools://devtools/ | 87 // An URLDataSource implementation that handles chrome-devtools://devtools/ |
86 // requests. Three types of requests could be handled based on the URL path: | 88 // requests. Three types of requests could be handled based on the URL path: |
87 // 1. /bundled/: bundled DevTools frontend is served. | 89 // 1. /bundled/: bundled DevTools frontend is served. |
88 // 2. /remote/: remote DevTools frontend is served from App Engine. | 90 // 2. /remote/: remote DevTools frontend is served from App Engine. |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 params.should_replace_current_entry = true; | 426 params.should_replace_current_entry = true; |
425 remote_frontend_loading_url_ = virtual_url; | 427 remote_frontend_loading_url_ = virtual_url; |
426 navigation_controller.LoadURLWithParams(params); | 428 navigation_controller.LoadURLWithParams(params); |
427 navigation_controller.GetPendingEntry()->SetVirtualURL(virtual_url); | 429 navigation_controller.GetPendingEntry()->SetVirtualURL(virtual_url); |
428 | 430 |
429 DevToolsAndroidBridge* bridge = | 431 DevToolsAndroidBridge* bridge = |
430 DevToolsAndroidBridge::Factory::GetForProfile(profile); | 432 DevToolsAndroidBridge::Factory::GetForProfile(profile); |
431 scoped_ptr<DevToolsTargetImpl> target(bridge->CreatePageTarget(page)); | 433 scoped_ptr<DevToolsTargetImpl> target(bridge->CreatePageTarget(page)); |
432 bindings_.AttachTo(target->GetAgentHost()); | 434 bindings_.AttachTo(target->GetAgentHost()); |
433 } | 435 } |
OLD | NEW |