summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_browser_context.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-14 02:40:35 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-14 02:40:35 +0000
commit5cba3bf230f84b111530d0478c95dda25e677e58 (patch)
tree03969d9108908393f3e364b9e8de89026d29c27c /content/shell/shell_browser_context.cc
parent1558fff3237b89156cb0c91a693122131533c286 (diff)
downloadchromium_src-5cba3bf230f84b111530d0478c95dda25e677e58.zip
chromium_src-5cba3bf230f84b111530d0478c95dda25e677e58.tar.gz
chromium_src-5cba3bf230f84b111530d0478c95dda25e677e58.tar.bz2
Content: First draft at a content_shell on GTK.
THIS IS NOT READY FOR DAILY USE. The shell, in its current state, can bring up the default google.com homepage. And that's about it. There are problems with the url bar, scrolling (weird crashes complaining about not having a ResourceBundle), it breaks badly on popups, et cetera. BUG=90445 TEST=none; this is a testing tool. Review URL: http://codereview.chromium.org/9213012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117768 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_browser_context.cc')
-rw-r--r--content/shell/shell_browser_context.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc
index a5ae692..f8d4961 100644
--- a/content/shell/shell_browser_context.cc
+++ b/content/shell/shell_browser_context.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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 "content/shell/shell_browser_context.h"
#include "base/bind.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -30,12 +31,19 @@
#if defined(OS_WIN)
#include "base/base_paths_win.h"
+#elif defined(OS_LINUX)
+#include "base/nix/xdg_util.h"
#endif
using content::BrowserThread;
namespace {
+#if defined(OS_LINUX)
+const char kDotConfigDir[] = ".config";
+const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME";
+#endif
+
class ShellGeolocationPermissionContext : public GeolocationPermissionContext {
public:
ShellGeolocationPermissionContext() {
@@ -104,6 +112,12 @@ FilePath ShellBrowserContext::GetPath() {
#if defined(OS_WIN)
CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_));
path_ = path_.Append(std::wstring(L"content_shell"));
+#elif defined(OS_LINUX)
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ FilePath config_dir(base::nix::GetXDGDirectory(env.get(),
+ kXdgConfigHomeEnvVar,
+ kDotConfigDir));
+ path_ = config_dir.Append("content_shell");
#else
NOTIMPLEMENTED();
#endif