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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_util.cc

Issue 101323002: Stop setting invalid value to the |tab_id| field of fileBrowserHandler API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "chrome/browser/chromeos/drive/drive.pb.h" 8 #include "chrome/browser/chromeos/drive/drive.pb.h"
9 #include "chrome/browser/chromeos/drive/file_errors.h" 9 #include "chrome/browser/chromeos/drive/file_errors.h"
10 #include "chrome/browser/chromeos/drive/file_system_interface.h" 10 #include "chrome/browser/chromeos/drive/file_system_interface.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 content::WebContents* web_contents = 229 content::WebContents* web_contents =
230 dispatcher->delegate()->GetAssociatedWebContents(); 230 dispatcher->delegate()->GetAssociatedWebContents();
231 if (!web_contents) { 231 if (!web_contents) {
232 LOG(WARNING) << "No associated tab contents"; 232 LOG(WARNING) << "No associated tab contents";
233 return NULL; 233 return NULL;
234 } 234 }
235 return web_contents; 235 return web_contents;
236 } 236 }
237 237
238 int32 GetTabId(ExtensionFunctionDispatcher* dispatcher) {
239 content::WebContents* web_contents = GetWebContents(dispatcher);
240 return web_contents ?
241 extensions::ExtensionTabUtil::GetTabId(web_contents) : 0;
242 }
243
244 base::FilePath GetLocalPathFromURL( 238 base::FilePath GetLocalPathFromURL(
245 content::RenderViewHost* render_view_host, 239 content::RenderViewHost* render_view_host,
246 Profile* profile, 240 Profile* profile,
247 const GURL& url) { 241 const GURL& url) {
248 DCHECK(render_view_host); 242 DCHECK(render_view_host);
249 DCHECK(profile); 243 DCHECK(profile);
250 244
251 scoped_refptr<fileapi::FileSystemContext> file_system_context = 245 scoped_refptr<fileapi::FileSystemContext> file_system_context =
252 util::GetFileSystemContextForRenderViewHost( 246 util::GetFileSystemContextForRenderViewHost(
253 profile, render_view_host); 247 profile, render_view_host);
(...skipping 30 matching lines...) Expand all
284 278
285 BrowserThread::PostTask( 279 BrowserThread::PostTask(
286 BrowserThread::UI, FROM_HERE, 280 BrowserThread::UI, FROM_HERE,
287 base::Bind(&GetSelectedFileInfoInternal, 281 base::Bind(&GetSelectedFileInfoInternal,
288 profile, 282 profile,
289 base::Passed(&params))); 283 base::Passed(&params)));
290 } 284 }
291 285
292 } // namespace util 286 } // namespace util
293 } // namespace file_manager 287 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698