Chromium Code Reviews| 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 "content/shell/browser/shell_browser_main_parts.h" | 5 #include "content/shell/browser/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 12 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 13 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/devtools_http_handler.h" | 16 #include "content/public/browser/devtools_http_handler.h" |
| 16 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
| 17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 18 #include "content/public/common/main_function_params.h" | 19 #include "content/public/common/main_function_params.h" |
| 19 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 20 #include "content/shell/browser/layout_test/layout_test_browser_context.h" | 21 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 return GURL(); | 58 return GURL(); |
| 58 #endif | 59 #endif |
| 59 | 60 |
| 60 if (args.empty()) | 61 if (args.empty()) |
| 61 return GURL("https://www.google.com/"); | 62 return GURL("https://www.google.com/"); |
| 62 | 63 |
| 63 GURL url(args[0]); | 64 GURL url(args[0]); |
| 64 if (url.is_valid() && url.has_scheme()) | 65 if (url.is_valid() && url.has_scheme()) |
| 65 return url; | 66 return url; |
| 66 | 67 |
| 67 return net::FilePathToFileURL(base::FilePath(args[0])); | 68 return net::FilePathToFileURL( |
|
davidben
2015/04/22 01:09:18
This change ought to be mirrored in
https://code.g
| |
| 69 base::MakeAbsoluteFilePath(base::FilePath(args[0]))); | |
|
Peter Kasting
2015/04/21 22:34:05
Nit: This would probably be safer as:
base::Fil
eugenebng
2015/04/23 12:01:52
I used FilePathToFileURL(base::MakeAbsoluteFilePat
| |
| 68 } | 70 } |
| 69 | 71 |
| 70 base::StringPiece PlatformResourceProvider(int key) { | 72 base::StringPiece PlatformResourceProvider(int key) { |
| 71 if (key == IDR_DIR_HEADER_HTML) { | 73 if (key == IDR_DIR_HEADER_HTML) { |
| 72 base::StringPiece html_data = | 74 base::StringPiece html_data = |
| 73 ui::ResourceBundle::GetSharedInstance().GetRawDataResource( | 75 ui::ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 74 IDR_DIR_HEADER_HTML); | 76 IDR_DIR_HEADER_HTML); |
| 75 return html_data; | 77 return html_data; |
| 76 } | 78 } |
| 77 return base::StringPiece(); | 79 return base::StringPiece(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 return !run_message_loop_; | 161 return !run_message_loop_; |
| 160 } | 162 } |
| 161 | 163 |
| 162 void ShellBrowserMainParts::PostMainMessageLoopRun() { | 164 void ShellBrowserMainParts::PostMainMessageLoopRun() { |
| 163 devtools_http_handler_.reset(); | 165 devtools_http_handler_.reset(); |
| 164 browser_context_.reset(); | 166 browser_context_.reset(); |
| 165 off_the_record_browser_context_.reset(); | 167 off_the_record_browser_context_.reset(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace | 170 } // namespace |
| OLD | NEW |