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

Side by Side Diff: content/shell/shell_content_browser_client.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 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 | Annotate | Revision Log
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 "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/notification_service.h" 10 #include "content/public/browser/notification_service.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 ShellContentBrowserClient::ShellContentBrowserClient() 83 ShellContentBrowserClient::ShellContentBrowserClient()
84 : hyphen_dictionary_file_(base::kInvalidPlatformFileValue), 84 : hyphen_dictionary_file_(base::kInvalidPlatformFileValue),
85 shell_browser_main_parts_(NULL) { 85 shell_browser_main_parts_(NULL) {
86 DCHECK(!g_browser_client); 86 DCHECK(!g_browser_client);
87 g_browser_client = this; 87 g_browser_client = this;
88 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 88 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
89 return; 89 return;
90 webkit_source_dir_ = GetWebKitRootDirFilePath(); 90 webkit_source_dir_ = GetWebKitRootDirFilePath();
91 base::FilePath dictionary_file_path = GetChromiumRootDirFilePath().Append( 91 base::FilePath dictionary_file_path = base::MakeAbsoluteFilePath(
92 FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic")); 92 GetChromiumRootDirFilePath().Append(
93 file_util::AbsolutePath(&dictionary_file_path); 93 FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic")));
94 hyphen_dictionary_file_ = base::CreatePlatformFile(dictionary_file_path, 94 hyphen_dictionary_file_ = base::CreatePlatformFile(dictionary_file_path,
95 base::PLATFORM_FILE_READ | 95 base::PLATFORM_FILE_READ |
96 base::PLATFORM_FILE_OPEN, 96 base::PLATFORM_FILE_OPEN,
97 NULL, 97 NULL,
98 NULL); 98 NULL);
99 } 99 }
100 100
101 ShellContentBrowserClient::~ShellContentBrowserClient() { 101 ShellContentBrowserClient::~ShellContentBrowserClient() {
102 g_browser_client = NULL; 102 g_browser_client = NULL;
103 } 103 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 ShellBrowserContext* 252 ShellBrowserContext*
253 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( 253 ShellContentBrowserClient::ShellBrowserContextForBrowserContext(
254 BrowserContext* content_browser_context) { 254 BrowserContext* content_browser_context) {
255 if (content_browser_context == browser_context()) 255 if (content_browser_context == browser_context())
256 return browser_context(); 256 return browser_context();
257 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); 257 DCHECK_EQ(content_browser_context, off_the_record_browser_context());
258 return off_the_record_browser_context(); 258 return off_the_record_browser_context();
259 } 259 }
260 260
261 } // namespace content 261 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698