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

Side by Side Diff: Source/web/LocalFileSystemClient.cpp

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/web/LocalFileSystemClient.h ('k') | Source/web/MIDIClientProxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 23 matching lines...) Expand all
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/workers/WorkerGlobalScope.h" 35 #include "core/workers/WorkerGlobalScope.h"
36 #include "platform/PermissionCallbacks.h" 36 #include "platform/PermissionCallbacks.h"
37 #include "platform/weborigin/SecurityOrigin.h" 37 #include "platform/weborigin/SecurityOrigin.h"
38 #include "public/platform/WebPermissionCallbacks.h" 38 #include "public/platform/WebPermissionCallbacks.h"
39 #include "public/web/WebPermissionClient.h" 39 #include "public/web/WebPermissionClient.h"
40 #include "web/WebLocalFrameImpl.h" 40 #include "web/WebLocalFrameImpl.h"
41 #include "web/WorkerPermissionClient.h" 41 #include "web/WorkerPermissionClient.h"
42 #include "wtf/text/WTFString.h" 42 #include "wtf/text/WTFString.h"
43 43
44 using namespace WebCore; 44 using namespace blink;
45 45
46 namespace blink { 46 namespace blink {
47 47
48 PassOwnPtr<FileSystemClient> LocalFileSystemClient::create() 48 PassOwnPtr<FileSystemClient> LocalFileSystemClient::create()
49 { 49 {
50 return adoptPtr(static_cast<FileSystemClient*>(new LocalFileSystemClient())) ; 50 return adoptPtr(static_cast<FileSystemClient*>(new LocalFileSystemClient())) ;
51 } 51 }
52 52
53 LocalFileSystemClient::~LocalFileSystemClient() 53 LocalFileSystemClient::~LocalFileSystemClient()
54 { 54 {
55 } 55 }
56 56
57 bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* contex t) 57 bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* contex t)
58 { 58 {
59 ASSERT(context); 59 ASSERT(context);
60 if (context->isDocument()) { 60 if (context->isDocument()) {
61 ASSERT_NOT_REACHED(); 61 ASSERT_NOT_REACHED();
62 return false; 62 return false;
63 } 63 }
64 64
65 ASSERT(context->isWorkerGlobalScope()); 65 ASSERT(context->isWorkerGlobalScope());
66 return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestF ileSystemAccessSync(); 66 return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestF ileSystemAccessSync();
67 } 67 }
68 68
69 void LocalFileSystemClient::requestFileSystemAccessAsync(ExecutionContext* conte xt, PassOwnPtr<WebCore::PermissionCallbacks> callbacks) 69 void LocalFileSystemClient::requestFileSystemAccessAsync(ExecutionContext* conte xt, PassOwnPtr<blink::PermissionCallbacks> callbacks)
70 { 70 {
71 ASSERT(context); 71 ASSERT(context);
72 if (!context->isDocument()) { 72 if (!context->isDocument()) {
73 ASSERT_NOT_REACHED(); 73 ASSERT_NOT_REACHED();
74 return; 74 return;
75 } 75 }
76 76
77 Document* document = toDocument(context); 77 Document* document = toDocument(context);
78 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame() ); 78 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame() );
79 if (!webFrame->permissionClient()) { 79 if (!webFrame->permissionClient()) {
80 callbacks->onAllowed(); 80 callbacks->onAllowed();
81 return; 81 return;
82 } 82 }
83 webFrame->permissionClient()->requestFileSystemAccessAsync(callbacks); 83 webFrame->permissionClient()->requestFileSystemAccessAsync(callbacks);
84 } 84 }
85 85
86 LocalFileSystemClient::LocalFileSystemClient() 86 LocalFileSystemClient::LocalFileSystemClient()
87 { 87 {
88 } 88 }
89 89
90 } // namespace blink 90 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/LocalFileSystemClient.h ('k') | Source/web/MIDIClientProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698