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

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

Issue 1137383002: Show the eject button only for removabled and file handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 7 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 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 <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // TODO(kinaba): fill appropriate information once multi-profile support is 175 // TODO(kinaba): fill appropriate information once multi-profile support is
176 // implemented. 176 // implemented.
177 volume_metadata->profile.display_name = profile->GetProfileUserName(); 177 volume_metadata->profile.display_name = profile->GetProfileUserName();
178 volume_metadata->profile.is_current_profile = true; 178 volume_metadata->profile.is_current_profile = true;
179 179
180 if (!volume.source_path().empty()) { 180 if (!volume.source_path().empty()) {
181 volume_metadata->source_path.reset( 181 volume_metadata->source_path.reset(
182 new std::string(volume.source_path().AsUTF8Unsafe())); 182 new std::string(volume.source_path().AsUTF8Unsafe()));
183 } 183 }
184 184
185 switch (volume.source()) {
186 case SOURCE_FILE:
187 volume_metadata->source = file_manager_private::SOURCE_FILE;
188 break;
189 case SOURCE_DEVICE:
190 volume_metadata->source = file_manager_private::SOURCE_DEVICE;
191 break;
192 case SOURCE_NETWORK:
193 volume_metadata->source =
194 extensions::api::file_manager_private::SOURCE_NETWORK;
195 break;
196 case SOURCE_SYSTEM:
197 volume_metadata->source =
198 extensions::api::file_manager_private::SOURCE_SYSTEM;
199 break;
200 }
201
202 volume_metadata->configurable = volume.configurable();
203
185 if (volume.type() == VOLUME_TYPE_PROVIDED) { 204 if (volume.type() == VOLUME_TYPE_PROVIDED) {
186 volume_metadata->extension_id.reset(new std::string(volume.extension_id())); 205 volume_metadata->extension_id.reset(new std::string(volume.extension_id()));
187 volume_metadata->file_system_id.reset( 206 volume_metadata->file_system_id.reset(
188 new std::string(volume.file_system_id())); 207 new std::string(volume.file_system_id()));
189 } 208 }
190 209
191 volume_metadata->volume_label.reset(new std::string(volume.volume_label())); 210 volume_metadata->volume_label.reset(new std::string(volume.volume_label()));
192 211
193 switch (volume.type()) { 212 switch (volume.type()) {
194 case VOLUME_TYPE_GOOGLE_DRIVE: 213 case VOLUME_TYPE_GOOGLE_DRIVE:
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 358 }
340 359
341 drive::EventLogger* GetLogger(Profile* profile) { 360 drive::EventLogger* GetLogger(Profile* profile) {
342 drive::DriveIntegrationService* service = 361 drive::DriveIntegrationService* service =
343 drive::DriveIntegrationServiceFactory::FindForProfile(profile); 362 drive::DriveIntegrationServiceFactory::FindForProfile(profile);
344 return service ? service->event_logger() : NULL; 363 return service ? service->event_logger() : NULL;
345 } 364 }
346 365
347 } // namespace util 366 } // namespace util
348 } // namespace file_manager 367 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698