| OLD | NEW |
| 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_manager/file_browser_private_a
pi.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <utime.h> | 10 #include <utime.h> |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 registry->RegisterFunction<SetPreferencesFunction>(); | 445 registry->RegisterFunction<SetPreferencesFunction>(); |
| 446 registry->RegisterFunction<SearchDriveFunction>(); | 446 registry->RegisterFunction<SearchDriveFunction>(); |
| 447 registry->RegisterFunction<SearchDriveMetadataFunction>(); | 447 registry->RegisterFunction<SearchDriveMetadataFunction>(); |
| 448 registry->RegisterFunction<ClearDriveCacheFunction>(); | 448 registry->RegisterFunction<ClearDriveCacheFunction>(); |
| 449 registry->RegisterFunction<ReloadDriveFunction>(); | 449 registry->RegisterFunction<ReloadDriveFunction>(); |
| 450 registry->RegisterFunction<GetDriveConnectionStateFunction>(); | 450 registry->RegisterFunction<GetDriveConnectionStateFunction>(); |
| 451 registry->RegisterFunction<RequestDirectoryRefreshFunction>(); | 451 registry->RegisterFunction<RequestDirectoryRefreshFunction>(); |
| 452 registry->RegisterFunction<SetLastModifiedFunction>(); | 452 registry->RegisterFunction<SetLastModifiedFunction>(); |
| 453 registry->RegisterFunction<ZipSelectionFunction>(); | 453 registry->RegisterFunction<ZipSelectionFunction>(); |
| 454 registry->RegisterFunction<ValidatePathNameLengthFunction>(); | 454 registry->RegisterFunction<ValidatePathNameLengthFunction>(); |
| 455 registry->RegisterFunction<OpenNewWindowFunction>(); | |
| 456 registry->RegisterFunction<ZoomFunction>(); | 455 registry->RegisterFunction<ZoomFunction>(); |
| 457 event_router_->ObserveFileSystemEvents(); | 456 event_router_->ObserveFileSystemEvents(); |
| 458 } | 457 } |
| 459 | 458 |
| 460 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { | 459 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { |
| 461 } | 460 } |
| 462 | 461 |
| 463 void FileBrowserPrivateAPI::Shutdown() { | 462 void FileBrowserPrivateAPI::Shutdown() { |
| 464 event_router_->Shutdown(); | 463 event_router_->Shutdown(); |
| 465 } | 464 } |
| (...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3077 return true; | 3076 return true; |
| 3078 } | 3077 } |
| 3079 | 3078 |
| 3080 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( | 3079 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( |
| 3081 size_t current_length, | 3080 size_t current_length, |
| 3082 size_t max_length) { | 3081 size_t max_length) { |
| 3083 SetResult(new base::FundamentalValue(current_length <= max_length)); | 3082 SetResult(new base::FundamentalValue(current_length <= max_length)); |
| 3084 SendResponse(true); | 3083 SendResponse(true); |
| 3085 } | 3084 } |
| 3086 | 3085 |
| 3087 OpenNewWindowFunction::OpenNewWindowFunction() {} | |
| 3088 | |
| 3089 OpenNewWindowFunction::~OpenNewWindowFunction() {} | |
| 3090 | |
| 3091 bool OpenNewWindowFunction::RunImpl() { | |
| 3092 std::string url; | |
| 3093 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); | |
| 3094 file_manager_util::OpenNewWindow(profile_, GURL(url)); | |
| 3095 return true; | |
| 3096 } | |
| 3097 | |
| 3098 bool ZoomFunction::RunImpl() { | 3086 bool ZoomFunction::RunImpl() { |
| 3099 content::RenderViewHost* const view_host = render_view_host(); | 3087 content::RenderViewHost* const view_host = render_view_host(); |
| 3100 std::string operation; | 3088 std::string operation; |
| 3101 args_->GetString(0, &operation); | 3089 args_->GetString(0, &operation); |
| 3102 content::PageZoom zoom_type; | 3090 content::PageZoom zoom_type; |
| 3103 if (operation == "in") { | 3091 if (operation == "in") { |
| 3104 zoom_type = content::PAGE_ZOOM_IN; | 3092 zoom_type = content::PAGE_ZOOM_IN; |
| 3105 } else if (operation == "out") { | 3093 } else if (operation == "out") { |
| 3106 zoom_type = content::PAGE_ZOOM_OUT; | 3094 zoom_type = content::PAGE_ZOOM_OUT; |
| 3107 } else if (operation == "reset") { | 3095 } else if (operation == "reset") { |
| 3108 zoom_type = content::PAGE_ZOOM_RESET; | 3096 zoom_type = content::PAGE_ZOOM_RESET; |
| 3109 } else { | 3097 } else { |
| 3110 NOTREACHED(); | 3098 NOTREACHED(); |
| 3111 return false; | 3099 return false; |
| 3112 } | 3100 } |
| 3113 view_host->Zoom(zoom_type); | 3101 view_host->Zoom(zoom_type); |
| 3114 return true; | 3102 return true; |
| 3115 } | 3103 } |
| OLD | NEW |