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

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: fix comment 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 logger->Log(logging::LOG_INFO, "%s succeeded.", name().c_str()); 161 logger->Log(logging::LOG_INFO, "%s succeeded.", name().c_str());
162 return true; 162 return true;
163 } 163 }
164 164
165 FileBrowserPrivateZipSelectionFunction:: 165 FileBrowserPrivateZipSelectionFunction::
166 FileBrowserPrivateZipSelectionFunction() {} 166 FileBrowserPrivateZipSelectionFunction() {}
167 167
168 FileBrowserPrivateZipSelectionFunction:: 168 FileBrowserPrivateZipSelectionFunction::
169 ~FileBrowserPrivateZipSelectionFunction() {} 169 ~FileBrowserPrivateZipSelectionFunction() {}
170 170
171 bool FileBrowserPrivateZipSelectionFunction::RunImpl() { 171 bool FileBrowserPrivateZipSelectionFunction::RunAsync() {
172 using extensions::api::file_browser_private::ZipSelection::Params; 172 using extensions::api::file_browser_private::ZipSelection::Params;
173 const scoped_ptr<Params> params(Params::Create(*args_)); 173 const scoped_ptr<Params> params(Params::Create(*args_));
174 EXTENSION_FUNCTION_VALIDATE(params); 174 EXTENSION_FUNCTION_VALIDATE(params);
175 175
176 // First param is the source directory URL. 176 // First param is the source directory URL.
177 if (params->dir_url.empty()) 177 if (params->dir_url.empty())
178 return false; 178 return false;
179 179
180 base::FilePath src_dir = file_manager::util::GetLocalPathFromURL( 180 base::FilePath src_dir = file_manager::util::GetLocalPathFromURL(
181 render_view_host(), GetProfile(), GURL(params->dir_url)); 181 render_view_host(), GetProfile(), GURL(params->dir_url));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 zoom_type = content::PAGE_ZOOM_RESET; 246 zoom_type = content::PAGE_ZOOM_RESET;
247 break; 247 break;
248 default: 248 default:
249 NOTREACHED(); 249 NOTREACHED();
250 return false; 250 return false;
251 } 251 }
252 render_view_host()->Zoom(zoom_type); 252 render_view_host()->Zoom(zoom_type);
253 return true; 253 return true;
254 } 254 }
255 255
256 bool FileBrowserPrivateInstallWebstoreItemFunction::RunImpl() { 256 bool FileBrowserPrivateInstallWebstoreItemFunction::RunAsync() {
257 using extensions::api::file_browser_private::InstallWebstoreItem::Params; 257 using extensions::api::file_browser_private::InstallWebstoreItem::Params;
258 const scoped_ptr<Params> params(Params::Create(*args_)); 258 const scoped_ptr<Params> params(Params::Create(*args_));
259 EXTENSION_FUNCTION_VALIDATE(params); 259 EXTENSION_FUNCTION_VALIDATE(params);
260 260
261 if (params->item_id.empty()) 261 if (params->item_id.empty())
262 return false; 262 return false;
263 263
264 const extensions::WebstoreStandaloneInstaller::Callback callback = 264 const extensions::WebstoreStandaloneInstaller::Callback callback =
265 base::Bind( 265 base::Bind(
266 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete, 266 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 302
303 FileBrowserPrivateRequestWebStoreAccessTokenFunction:: 303 FileBrowserPrivateRequestWebStoreAccessTokenFunction::
304 FileBrowserPrivateRequestWebStoreAccessTokenFunction() { 304 FileBrowserPrivateRequestWebStoreAccessTokenFunction() {
305 } 305 }
306 306
307 FileBrowserPrivateRequestWebStoreAccessTokenFunction:: 307 FileBrowserPrivateRequestWebStoreAccessTokenFunction::
308 ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() { 308 ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() {
309 } 309 }
310 310
311 bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunImpl() { 311 bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunAsync() {
312 std::vector<std::string> scopes; 312 std::vector<std::string> scopes;
313 scopes.push_back(kCWSScope); 313 scopes.push_back(kCWSScope);
314 314
315 ProfileOAuth2TokenService* oauth_service = 315 ProfileOAuth2TokenService* oauth_service =
316 ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile()); 316 ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
317 net::URLRequestContextGetter* url_request_context_getter = 317 net::URLRequestContextGetter* url_request_context_getter =
318 g_browser_process->system_request_context(); 318 g_browser_process->system_request_context();
319 319
320 if (!oauth_service) { 320 if (!oauth_service) {
321 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); 321 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(), 437 if (!window_manager->IsWindowOnDesktopOfUser(app_window->GetNativeWindow(),
438 params->profile_id)) { 438 params->profile_id)) {
439 SetError("The window cannot visit the desktop."); 439 SetError("The window cannot visit the desktop.");
440 return false; 440 return false;
441 } 441 }
442 442
443 return true; 443 return true;
444 } 444 }
445 445
446 } // namespace extensions 446 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698