blob: 0e173f80e7b162dfac6112e3597da9cd687d8bb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "base/path_service.h"
#include "build/build_config.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/l10n_util.h"
#include "chrome/plugin/npobject_util.h"
#include "googleurl/src/url_util.h"
#include "webkit/glue/webkit_glue.h"
namespace webkit_glue {
bool GetExeDirectory(std::wstring *path) {
return PathService::Get(base::DIR_EXE, path);
}
bool GetApplicationDirectory(std::wstring *path) {
return PathService::Get(chrome::DIR_APP, path);
}
bool IsPluginRunningInRendererProcess() {
#if defined(OS_WIN)
return !IsPluginProcess();
#else
// TODO(port): We need an implementation of IsPluginProcess.
NOTIMPLEMENTED();
return false;
#endif
}
std::wstring GetWebKitLocale() {
// The browser process should have passed the locale to the renderer via the
// --lang command line flag. In single process mode, this will return the
// wrong value. TODO(tc): Fix this for single process mode.
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
const std::wstring& lang =
parsed_command_line.GetSwitchValue(switches::kLang);
DCHECK(!lang.empty() ||
(!parsed_command_line.HasSwitch(switches::kRendererProcess) &&
!parsed_command_line.HasSwitch(switches::kPluginProcess)));
return lang;
}
std::wstring GetLocalizedString(int message_id) {
return l10n_util::GetString(message_id);
}
} // namespace webkit_glue
|