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

Side by Side Diff: chromecast/shell/browser/cast_browser_context.cc

Issue 591413006: Chromecast: set Android profile dir and ensure it exists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/shell/browser/cast_browser_context.h" 5 #include "chromecast/shell/browser/cast_browser_context.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chromecast/common/cast_paths.h" 10 #include "chromecast/common/cast_paths.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 CastBrowserContext::~CastBrowserContext() { 54 CastBrowserContext::~CastBrowserContext() {
55 content::BrowserThread::DeleteSoon( 55 content::BrowserThread::DeleteSoon(
56 content::BrowserThread::IO, 56 content::BrowserThread::IO,
57 FROM_HERE, 57 FROM_HERE,
58 resource_context_.release()); 58 resource_context_.release());
59 } 59 }
60 60
61 void CastBrowserContext::InitWhileIOAllowed() { 61 void CastBrowserContext::InitWhileIOAllowed() {
62 #if defined(OS_ANDROID)
63 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path_));
64 path_ = path_.Append(FILE_PATH_LITERAL("cast_shell"));
65
66 if (!base::PathExists(path_))
67 base::CreateDirectory(path_);
68 #else
62 // Chromecast doesn't support user profiles nor does it have 69 // Chromecast doesn't support user profiles nor does it have
63 // incognito mode. This means that all of the persistent 70 // incognito mode. This means that all of the persistent
64 // data (currently only cookies and local storage) will be 71 // data (currently only cookies and local storage) will be
65 // shared in a single location as defined here. 72 // shared in a single location as defined here.
66 CHECK(PathService::Get(DIR_CAST_HOME, &path_)); 73 CHECK(PathService::Get(DIR_CAST_HOME, &path_));
74 #endif // defined(OS_ANDROID)
67 } 75 }
68 76
69 base::FilePath CastBrowserContext::GetPath() const { 77 base::FilePath CastBrowserContext::GetPath() const {
70 return path_; 78 return path_;
71 } 79 }
72 80
73 bool CastBrowserContext::IsOffTheRecord() const { 81 bool CastBrowserContext::IsOffTheRecord() const {
74 return false; 82 return false;
75 } 83 }
76 84
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return NULL; 132 return NULL;
125 } 133 }
126 134
127 content::SSLHostStateDelegate* CastBrowserContext::GetSSLHostStateDelegate() { 135 content::SSLHostStateDelegate* CastBrowserContext::GetSSLHostStateDelegate() {
128 NOTIMPLEMENTED(); 136 NOTIMPLEMENTED();
129 return NULL; 137 return NULL;
130 } 138 }
131 139
132 } // namespace shell 140 } // namespace shell
133 } // namespace chromecast 141 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698