| 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/extensions/api/webstore_private/webstore_private_api.h" | 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
| 6 | 6 |
| 7 #include "apps/app_launcher.h" | 7 #include "apps/app_launcher.h" |
| 8 #include "apps/switches.h" | 8 #include "apps/switches.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 // The response is sent asynchronously in OnWebstoreParseSuccess/ | 289 // The response is sent asynchronously in OnWebstoreParseSuccess/ |
| 290 // OnWebstoreParseFailure. | 290 // OnWebstoreParseFailure. |
| 291 return true; | 291 return true; |
| 292 } | 292 } |
| 293 | 293 |
| 294 | 294 |
| 295 void BeginInstallWithManifestFunction::SetResultCode(ResultCode code) { | 295 void BeginInstallWithManifestFunction::SetResultCode(ResultCode code) { |
| 296 switch (code) { | 296 switch (code) { |
| 297 case ERROR_NONE: | 297 case ERROR_NONE: |
| 298 SetResult(Value::CreateStringValue("")); | 298 SetResult(Value::CreateStringValue(std::string())); |
| 299 break; | 299 break; |
| 300 case UNKNOWN_ERROR: | 300 case UNKNOWN_ERROR: |
| 301 SetResult(Value::CreateStringValue("unknown_error")); | 301 SetResult(Value::CreateStringValue("unknown_error")); |
| 302 break; | 302 break; |
| 303 case USER_CANCELLED: | 303 case USER_CANCELLED: |
| 304 SetResult(Value::CreateStringValue("user_cancelled")); | 304 SetResult(Value::CreateStringValue("user_cancelled")); |
| 305 break; | 305 break; |
| 306 case MANIFEST_ERROR: | 306 case MANIFEST_ERROR: |
| 307 SetResult(Value::CreateStringValue("manifest_error")); | 307 SetResult(Value::CreateStringValue("manifest_error")); |
| 308 break; | 308 break; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 331 CHECK(parsed_manifest); | 331 CHECK(parsed_manifest); |
| 332 icon_ = icon; | 332 icon_ = icon; |
| 333 parsed_manifest_.reset(parsed_manifest); | 333 parsed_manifest_.reset(parsed_manifest); |
| 334 | 334 |
| 335 std::string error; | 335 std::string error; |
| 336 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( | 336 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
| 337 parsed_manifest_.get(), | 337 parsed_manifest_.get(), |
| 338 Extension::FROM_WEBSTORE, | 338 Extension::FROM_WEBSTORE, |
| 339 id, | 339 id, |
| 340 localized_name_, | 340 localized_name_, |
| 341 "", | 341 std::string(), |
| 342 &error); | 342 &error); |
| 343 | 343 |
| 344 if (!dummy_extension_) { | 344 if (!dummy_extension_) { |
| 345 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, | 345 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, |
| 346 kInvalidManifestError); | 346 kInvalidManifestError); |
| 347 return; | 347 return; |
| 348 } | 348 } |
| 349 | 349 |
| 350 content::WebContents* web_contents = GetAssociatedWebContents(); | 350 content::WebContents* web_contents = GetAssociatedWebContents(); |
| 351 if (!web_contents) // The browser window has gone away. | 351 if (!web_contents) // The browser window has gone away. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); | 618 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); |
| 619 return true; | 619 return true; |
| 620 } | 620 } |
| 621 | 621 |
| 622 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { | 622 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { |
| 623 SetResult(Value::CreateBooleanValue(is_enabled)); | 623 SetResult(Value::CreateBooleanValue(is_enabled)); |
| 624 SendResponse(true); | 624 SendResponse(true); |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace extensions | 627 } // namespace extensions |
| OLD | NEW |