OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 GURL install_url(extension_urls::GetWebstoreInstallUrl( | 364 GURL install_url(extension_urls::GetWebstoreInstallUrl( |
365 id, g_browser_process->GetApplicationLocale())); | 365 id, g_browser_process->GetApplicationLocale())); |
366 | 366 |
367 // The download url for the given |id| is now contained in |url|. We | 367 // The download url for the given |id| is now contained in |url|. We |
368 // navigate the current (calling) tab to this url which will result in a | 368 // navigate the current (calling) tab to this url which will result in a |
369 // download starting. Once completed it will go through the normal extension | 369 // download starting. Once completed it will go through the normal extension |
370 // install flow. The above call to SetWhitelistedInstallId will bypass the | 370 // install flow. The above call to SetWhitelistedInstallId will bypass the |
371 // normal permissions install dialog. | 371 // normal permissions install dialog. |
372 NavigationController& controller = | 372 NavigationController& controller = |
373 dispatcher()->delegate()->GetAssociatedTabContents()->controller(); | 373 dispatcher()->delegate()->GetAssociatedTabContents()->controller(); |
374 controller.LoadURL(install_url, source_url(), PageTransition::LINK, | 374 controller.LoadURL(install_url, source_url(), content::PAGE_TRANSITION_LINK, |
375 std::string()); | 375 std::string()); |
376 | 376 |
377 return true; | 377 return true; |
378 } | 378 } |
379 | 379 |
380 bool GetBrowserLoginFunction::RunImpl() { | 380 bool GetBrowserLoginFunction::RunImpl() { |
381 if (!IsWebStoreURL(profile_, source_url())) | 381 if (!IsWebStoreURL(profile_, source_url())) |
382 return false; | 382 return false; |
383 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); | 383 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); |
384 return true; | 384 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
401 bool SetStoreLoginFunction::RunImpl() { | 401 bool SetStoreLoginFunction::RunImpl() { |
402 if (!IsWebStoreURL(profile_, source_url())) | 402 if (!IsWebStoreURL(profile_, source_url())) |
403 return false; | 403 return false; |
404 std::string login; | 404 std::string login; |
405 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &login)); | 405 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &login)); |
406 ExtensionService* service = profile_->GetExtensionService(); | 406 ExtensionService* service = profile_->GetExtensionService(); |
407 ExtensionPrefs* prefs = service->extension_prefs(); | 407 ExtensionPrefs* prefs = service->extension_prefs(); |
408 prefs->SetWebStoreLogin(login); | 408 prefs->SetWebStoreLogin(login); |
409 return true; | 409 return true; |
410 } | 410 } |
OLD | NEW |