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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_event_router.cc

Issue 9796013: Set sourceUrl property of mountpoint info for gdata to empty string if mount fails. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_browser_event_router.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 DiskMountManager::MountTypeToString(mount_info.mount_type)); 363 DiskMountManager::MountTypeToString(mount_info.mount_type));
364 364
365 if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE || 365 if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE ||
366 mount_info.mount_type == chromeos::MOUNT_TYPE_GDATA) { 366 mount_info.mount_type == chromeos::MOUNT_TYPE_GDATA) {
367 GURL source_url; 367 GURL source_url;
368 if (file_manager_util::ConvertFileToFileSystemUrl(profile_, 368 if (file_manager_util::ConvertFileToFileSystemUrl(profile_,
369 FilePath(mount_info.source_path), 369 FilePath(mount_info.source_path),
370 file_manager_util::GetFileBrowserExtensionUrl().GetOrigin(), 370 file_manager_util::GetFileBrowserExtensionUrl().GetOrigin(),
371 &source_url)) { 371 &source_url)) {
372 mount_info_value->SetString("sourceUrl", source_url.spec()); 372 mount_info_value->SetString("sourceUrl", source_url.spec());
373 } else {
374 // If mounting of gdata moutn point failed, we may not be able to convert
achuithb 2012/03/21 19:38:29 nit: moutn->mount
375 // source path to source url, so let just send empty string.
376 DCHECK(mount_info.mount_type == chromeos::MOUNT_TYPE_GDATA &&
377 error_code != chromeos::MOUNT_ERROR_NONE);
378 mount_info_value->SetString("sourceUrl", "");
373 } 379 }
374 } else { 380 } else {
375 mount_info_value->SetString("sourceUrl", mount_info.source_path); 381 mount_info_value->SetString("sourceUrl", mount_info.source_path);
376 } 382 }
377 383
378 FilePath relative_mount_path; 384 FilePath relative_mount_path;
379 bool relative_mount_path_set = false; 385 bool relative_mount_path_set = false;
380 386
381 // If there were no error or some special conditions occured, add mountPath 387 // If there were no error or some special conditions occured, add mountPath
382 // to the event. 388 // to the event.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } 607 }
602 608
603 FileBrowserEventRouterFactory::~FileBrowserEventRouterFactory() { 609 FileBrowserEventRouterFactory::~FileBrowserEventRouterFactory() {
604 } 610 }
605 611
606 scoped_refptr<RefcountedProfileKeyedService> 612 scoped_refptr<RefcountedProfileKeyedService>
607 FileBrowserEventRouterFactory::BuildServiceInstanceFor(Profile* profile) const { 613 FileBrowserEventRouterFactory::BuildServiceInstanceFor(Profile* profile) const {
608 return scoped_refptr<RefcountedProfileKeyedService>( 614 return scoped_refptr<RefcountedProfileKeyedService>(
609 new FileBrowserEventRouter(profile)); 615 new FileBrowserEventRouter(profile));
610 } 616 }
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