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

Side by Side Diff: mojo/shell/storage.cc

Issue 27943002: Teach mojo_shell how to load http URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix lifetime Created 7 years, 2 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/shell/storage.h"
6
7 #include "base/environment.h"
8 #include "base/file_util.h"
9 #include "base/path_service.h"
10
11 #if defined(OS_WIN)
12 #include "base/base_paths_win.h"
13 #elif defined(OS_LINUX)
14 #include "base/nix/xdg_util.h"
15 #elif defined(OS_MACOSX)
16 #include "base/base_paths_mac.h"
17 #endif
18
19 namespace mojo {
20 namespace shell {
21
22 Storage::Storage() {
23 #if defined(OS_WIN)
24 CHECK(base::PathService::Get(base::DIR_LOCAL_APP_DATA, &profile_path_));
25 profile_path_ = profile_path_.Append(std::wstring(L"mojo_shell"));
26 #elif defined(OS_LINUX)
27 scoped_ptr<base::Environment> env(base::Environment::Create());
28 base::FilePath config_dir(
29 base::nix::GetXDGDirectory(env.get(),
30 base::nix::kXdgConfigHomeEnvVar,
31 base::nix::kDotConfigDir));
32 profile_path_ = config_dir.Append("mojo_shell");
33 #elif defined(OS_MACOSX)
34 CHECK(base::PathService::Get(base::DIR_APP_DATA, &profile_path_));
35 profile_path_ = profile_path_.Append("Chromium Mojo Shell");
36 #elif defined(OS_ANDROID)
37 CHECK(base::PathService::Get(base::DIR_ANDROID_APP_DATA, &profile_path_));
38 profile_path_ = profile_path_.Append(FILE_PATH_LITERAL("mojo_shell"));
39 #else
40 NOTIMPLEMENTED();
41 #endif
42
43 if (!base::PathExists(profile_path_))
44 file_util::CreateDirectory(profile_path_);
45 }
46
47 Storage::~Storage() {
48 }
49
50 } // namespace shell
51 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698