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

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

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: appshell Created 6 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 | 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_misc.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "ash/frame/frame_util.h" 9 #include "ash/frame/frame_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 logger->Log(logging::LOG_INFO, "%s succeeded.", name().c_str()); 160 logger->Log(logging::LOG_INFO, "%s succeeded.", name().c_str());
161 return true; 161 return true;
162 } 162 }
163 163
164 FileBrowserPrivateZipSelectionFunction:: 164 FileBrowserPrivateZipSelectionFunction::
165 FileBrowserPrivateZipSelectionFunction() {} 165 FileBrowserPrivateZipSelectionFunction() {}
166 166
167 FileBrowserPrivateZipSelectionFunction:: 167 FileBrowserPrivateZipSelectionFunction::
168 ~FileBrowserPrivateZipSelectionFunction() {} 168 ~FileBrowserPrivateZipSelectionFunction() {}
169 169
170 bool FileBrowserPrivateZipSelectionFunction::RunImpl() { 170 bool FileBrowserPrivateZipSelectionFunction::RunAsync() {
171 using extensions::api::file_browser_private::ZipSelection::Params; 171 using extensions::api::file_browser_private::ZipSelection::Params;
172 const scoped_ptr<Params> params(Params::Create(*args_)); 172 const scoped_ptr<Params> params(Params::Create(*args_));
173 EXTENSION_FUNCTION_VALIDATE(params); 173 EXTENSION_FUNCTION_VALIDATE(params);
174 174
175 // First param is the source directory URL. 175 // First param is the source directory URL.
176 if (params->dir_url.empty()) 176 if (params->dir_url.empty())
177 return false; 177 return false;
178 178
179 base::FilePath src_dir = file_manager::util::GetLocalPathFromURL( 179 base::FilePath src_dir = file_manager::util::GetLocalPathFromURL(
180 render_view_host(), GetProfile(), GURL(params->dir_url)); 180 render_view_host(), GetProfile(), GURL(params->dir_url));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 zoom_type = content::PAGE_ZOOM_RESET; 250 zoom_type = content::PAGE_ZOOM_RESET;
251 break; 251 break;
252 default: 252 default:
253 NOTREACHED(); 253 NOTREACHED();
254 return false; 254 return false;
255 } 255 }
256 render_view_host()->Zoom(zoom_type); 256 render_view_host()->Zoom(zoom_type);
257 return true; 257 return true;
258 } 258 }
259 259
260 bool FileBrowserPrivateInstallWebstoreItemFunction::RunImpl() { 260 bool FileBrowserPrivateInstallWebstoreItemFunction::RunAsync() {
261 using extensions::api::file_browser_private::InstallWebstoreItem::Params; 261 using extensions::api::file_browser_private::InstallWebstoreItem::Params;
262 const scoped_ptr<Params> params(Params::Create(*args_)); 262 const scoped_ptr<Params> params(Params::Create(*args_));
263 EXTENSION_FUNCTION_VALIDATE(params); 263 EXTENSION_FUNCTION_VALIDATE(params);
264 264
265 if (params->item_id.empty()) 265 if (params->item_id.empty())
266 return false; 266 return false;
267 267
268 const extensions::WebstoreStandaloneInstaller::Callback callback = 268 const extensions::WebstoreStandaloneInstaller::Callback callback =
269 base::Bind( 269 base::Bind(
270 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete, 270 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 306
307 FileBrowserPrivateRequestWebStoreAccessTokenFunction:: 307 FileBrowserPrivateRequestWebStoreAccessTokenFunction::
308 FileBrowserPrivateRequestWebStoreAccessTokenFunction() { 308 FileBrowserPrivateRequestWebStoreAccessTokenFunction() {
309 } 309 }
310 310
311 FileBrowserPrivateRequestWebStoreAccessTokenFunction:: 311 FileBrowserPrivateRequestWebStoreAccessTokenFunction::
312 ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() { 312 ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() {
313 } 313 }
314 314
315 bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunImpl() { 315 bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunAsync() {
316 std::vector<std::string> scopes; 316 std::vector<std::string> scopes;
317 scopes.push_back(kCWSScope); 317 scopes.push_back(kCWSScope);
318 318
319 ProfileOAuth2TokenService* oauth_service = 319 ProfileOAuth2TokenService* oauth_service =
320 ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile()); 320 ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
321 net::URLRequestContextGetter* url_request_context_getter = 321 net::URLRequestContextGetter* url_request_context_getter =
322 g_browser_process->system_request_context(); 322 g_browser_process->system_request_context();
323 323
324 if (!oauth_service) { 324 if (!oauth_service) {
325 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); 325 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(), 441 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(),
442 params->profile_id)) { 442 params->profile_id)) {
443 SetError("The window cannot visit the desktop."); 443 SetError("The window cannot visit the desktop.");
444 return false; 444 return false;
445 } 445 }
446 446
447 return true; 447 return true;
448 } 448 }
449 449
450 } // namespace extensions 450 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698