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

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: Add missing include 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
« no previous file with comments | « mojo/shell/storage.h ('k') | mojo/shell/task_runners.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/logging.h"
10 #include "base/path_service.h"
11
12 #if defined(OS_WIN)
13 #include "base/base_paths_win.h"
14 #elif defined(OS_LINUX)
15 #include "base/nix/xdg_util.h"
16 #elif defined(OS_MACOSX)
17 #include "base/base_paths_mac.h"
18 #endif
19
20 namespace mojo {
21 namespace shell {
22
23 Storage::Storage() {
24 #if defined(OS_WIN)
25 CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &profile_path_));
26 profile_path_ = profile_path_.Append(FILE_PATH_LITERAL("mojo_shell"));
27 #elif defined(OS_LINUX)
28 scoped_ptr<base::Environment> env(base::Environment::Create());
29 base::FilePath config_dir(
30 base::nix::GetXDGDirectory(env.get(),
31 base::nix::kXdgConfigHomeEnvVar,
32 base::nix::kDotConfigDir));
33 profile_path_ = config_dir.Append("mojo_shell");
34 #elif defined(OS_MACOSX)
35 CHECK(PathService::Get(base::DIR_APP_DATA, &profile_path_));
36 profile_path_ = profile_path_.Append("Chromium Mojo Shell");
37 #elif defined(OS_ANDROID)
38 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &profile_path_));
39 profile_path_ = profile_path_.Append(FILE_PATH_LITERAL("mojo_shell"));
40 #else
41 NOTIMPLEMENTED();
42 #endif
43
44 if (!base::PathExists(profile_path_))
45 file_util::CreateDirectory(profile_path_);
46 }
47
48 Storage::~Storage() {
49 }
50
51 } // namespace shell
52 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/storage.h ('k') | mojo/shell/task_runners.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698