| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file defines utility functions for working with strings. | 5 // This file defines utility functions for working with strings. |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/debugger/debugger_contents.h" | 10 #include "chrome/browser/debugger/debugger_contents.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } else if (path == "debugger.js") { | 33 } else if (path == "debugger.js") { |
| 34 resource_id = IDR_DEBUGGER_JS; | 34 resource_id = IDR_DEBUGGER_JS; |
| 35 } else if (path == "debugger.css") { | 35 } else if (path == "debugger.css") { |
| 36 resource_id = IDR_DEBUGGER_CSS; | 36 resource_id = IDR_DEBUGGER_CSS; |
| 37 } else { | 37 } else { |
| 38 SendResponse(request_id, NULL); | 38 SendResponse(request_id, NULL); |
| 39 return; | 39 return; |
| 40 } | 40 } |
| 41 | 41 |
| 42 std::wstring debugger_path = | 42 std::wstring debugger_path = |
| 43 CommandLine().GetSwitchValue(switches::kJavaScriptDebuggerPath); | 43 CommandLine::ForCurrentProcess()->GetSwitchValue( |
| 44 switches::kJavaScriptDebuggerPath); |
| 44 std::string data_str; | 45 std::string data_str; |
| 45 if (!debugger_path.empty() && file_util::PathExists(debugger_path)) { | 46 if (!debugger_path.empty() && file_util::PathExists(debugger_path)) { |
| 46 if (path.empty()) | 47 if (path.empty()) |
| 47 file_util::AppendToPath(&debugger_path, L"debugger.html"); | 48 file_util::AppendToPath(&debugger_path, L"debugger.html"); |
| 48 else | 49 else |
| 49 file_util::AppendToPath(&debugger_path, UTF8ToWide(path)); | 50 file_util::AppendToPath(&debugger_path, UTF8ToWide(path)); |
| 50 if (!file_util::ReadFileToString(debugger_path, &data_str)) { | 51 if (!file_util::ReadFileToString(debugger_path, &data_str)) { |
| 51 SendResponse(request_id, NULL); | 52 SendResponse(request_id, NULL); |
| 52 return; | 53 return; |
| 53 } | 54 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 NewRunnableMethod(&chrome_url_data_manager, | 123 NewRunnableMethod(&chrome_url_data_manager, |
| 123 &ChromeURLDataManager::AddDataSource, | 124 &ChromeURLDataManager::AddDataSource, |
| 124 html_source)); | 125 html_source)); |
| 125 } | 126 } |
| 126 | 127 |
| 127 // static | 128 // static |
| 128 bool DebuggerContents::IsDebuggerUrl(const GURL& url) { | 129 bool DebuggerContents::IsDebuggerUrl(const GURL& url) { |
| 129 return (url.SchemeIs("chrome") && url.host() == "inspector"); | 130 return (url.SchemeIs("chrome") && url.host() == "inspector"); |
| 130 } | 131 } |
| 131 | 132 |
| OLD | NEW |