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

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 some style nits 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 "base/environment.h"
6 #include "base/file_util.h"
7 #include "base/path_service.h"
8 #include "mojo/shell/storage.h"
9
10 #if defined(OS_WIN)
11 #include "base/base_paths_win.h"
12 #elif defined(OS_LINUX)
13 #include "base/nix/xdg_util.h"
14 #elif defined(OS_MACOSX)
15 #include "base/base_paths_mac.h"
16 #endif
17
18 namespace mojo {
19 namespace shell {
20
21 Storage::Storage() {
22 #if defined(OS_WIN)
23 CHECK(base::PathService::Get(base::DIR_LOCAL_APP_DATA, &profile_path_));
24 profile_path_ = profile_path_.Append(std::wstring(L"mojo_shell"));
25 #elif defined(OS_LINUX)
26 scoped_ptr<base::Environment> env(base::Environment::Create());
27 base::FilePath config_dir(
28 base::nix::GetXDGDirectory(env.get(),
29 base::nix::kXdgConfigHomeEnvVar,
30 base::nix::kDotConfigDir));
31 profile_path_ = config_dir.Append("mojo_shell");
32 #elif defined(OS_MACOSX)
33 CHECK(base::PathService::Get(base::DIR_APP_DATA, &profile_path_));
34 profile_path_ = profile_path_.Append("Chromium Mojo Shell");
35 #elif defined(OS_ANDROID)
36 CHECK(base::PathService::Get(base::DIR_ANDROID_APP_DATA, &profile_path_));
37 profile_path_ = profile_path_.Append(FILE_PATH_LITERAL("mojo_shell"));
38 #else
39 NOTIMPLEMENTED();
40 #endif
41
42 if (!base::PathExists(profile_path_))
43 file_util::CreateDirectory(profile_path_);
44 }
45
46 Storage::~Storage() {
47 }
48
49 } // namespace shell
50 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698