Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/ui/webui/devtools_ui.cc

Issue 1035873002: [DevTools] Support SVG file in DevTools window. [1/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698