| 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 "content/shell/shell_content_browser_client.h" | 5 #include "content/shell/shell_content_browser_client.h" |
| 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 "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 ShellContentBrowserClient::ShellContentBrowserClient() | 75 ShellContentBrowserClient::ShellContentBrowserClient() |
| 76 : hyphen_dictionary_file_(base::kInvalidPlatformFileValue), | 76 : hyphen_dictionary_file_(base::kInvalidPlatformFileValue), |
| 77 shell_browser_main_parts_(NULL) { | 77 shell_browser_main_parts_(NULL) { |
| 78 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 78 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 79 return; | 79 return; |
| 80 webkit_source_dir_ = GetWebKitRootDirFilePath(); | 80 webkit_source_dir_ = GetWebKitRootDirFilePath(); |
| 81 base::FilePath dictionary_file_path = GetChromiumRootDirFilePath().Append( | 81 base::FilePath dictionary_file_path = GetChromiumRootDirFilePath().Append( |
| 82 FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic")); | 82 FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic")).AsAbsolute(); |
| 83 file_util::AbsolutePath(&dictionary_file_path); | |
| 84 hyphen_dictionary_file_ = base::CreatePlatformFile(dictionary_file_path, | 83 hyphen_dictionary_file_ = base::CreatePlatformFile(dictionary_file_path, |
| 85 base::PLATFORM_FILE_READ | | 84 base::PLATFORM_FILE_READ | |
| 86 base::PLATFORM_FILE_OPEN, | 85 base::PLATFORM_FILE_OPEN, |
| 87 NULL, | 86 NULL, |
| 88 NULL); | 87 NULL); |
| 89 } | 88 } |
| 90 | 89 |
| 91 ShellContentBrowserClient::~ShellContentBrowserClient() { | 90 ShellContentBrowserClient::~ShellContentBrowserClient() { |
| 92 } | 91 } |
| 93 | 92 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 ShellBrowserContext* | 221 ShellBrowserContext* |
| 223 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 222 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 224 BrowserContext* content_browser_context) { | 223 BrowserContext* content_browser_context) { |
| 225 if (content_browser_context == browser_context()) | 224 if (content_browser_context == browser_context()) |
| 226 return browser_context(); | 225 return browser_context(); |
| 227 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 226 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 228 return off_the_record_browser_context(); | 227 return off_the_record_browser_context(); |
| 229 } | 228 } |
| 230 | 229 |
| 231 } // namespace content | 230 } // namespace content |
| OLD | NEW |