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

Side by Side Diff: android_webview/common/aw_paths.cc

Issue 2932703003: Plumbing for safe browsing reporting for Android WebView. (Closed)
Patch Set: modify client name to android_webview Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "android_webview/common/aw_paths.h" 5 #include "android_webview/common/aw_paths.h"
6 6
7 #include "base/android/path_utils.h" 7 #include "base/android/path_utils.h"
8 #include "base/base_paths_android.h" 8 #include "base/base_paths_android.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 11
12 namespace android_webview { 12 namespace android_webview {
13 13
14 bool PathProvider(int key, base::FilePath* result) { 14 bool PathProvider(int key, base::FilePath* result) {
15 base::FilePath cur; 15 base::FilePath cur;
16 16
17 switch (key) { 17 switch (key) {
18 case DIR_CRASH_DUMPS: 18 case DIR_CRASH_DUMPS:
19 if (!base::android::GetCacheDirectory(&cur)) 19 if (!base::android::GetCacheDirectory(&cur))
20 return false; 20 return false;
21 cur = cur.Append(FILE_PATH_LITERAL("WebView")) 21 cur = cur.Append(FILE_PATH_LITERAL("WebView"))
22 .Append(FILE_PATH_LITERAL("Crash Reports")); 22 .Append(FILE_PATH_LITERAL("Crash Reports"));
23 break; 23 break;
24 case DIR_SAFE_BROWSING:
25 if (!base::android::GetCacheDirectory(&cur))
26 return false;
27 cur = cur.Append(FILE_PATH_LITERAL("WebView"))
28 .Append(FILE_PATH_LITERAL("SafeBrowsing"));
29 break;
24 default: 30 default:
25 return false; 31 return false;
26 } 32 }
27 33
28 *result = cur; 34 *result = cur;
29 return true; 35 return true;
30 } 36 }
31 37
32 void RegisterPathProvider() { 38 void RegisterPathProvider() {
33 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 39 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
34 } 40 }
35 41
36 } // namespace android_webview 42 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/common/aw_paths.h ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698