| 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/extension_management_api.h" | 5 #include "chrome/browser/extensions/extension_management_api.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 error_ = keys::kGestureNeededForEscalationError; | 375 error_ = keys::kGestureNeededForEscalationError; |
| 376 return false; | 376 return false; |
| 377 } | 377 } |
| 378 AddRef(); // Matched in InstallUIProceed/InstallUIAbort | 378 AddRef(); // Matched in InstallUIProceed/InstallUIAbort |
| 379 install_ui_.reset(new ExtensionInstallUI(profile_)); | 379 install_ui_.reset(new ExtensionInstallUI(profile_)); |
| 380 install_ui_->ConfirmReEnable(this, extension); | 380 install_ui_->ConfirmReEnable(this, extension); |
| 381 return true; | 381 return true; |
| 382 } | 382 } |
| 383 service()->EnableExtension(extension_id_); | 383 service()->EnableExtension(extension_id_); |
| 384 } else if (currently_enabled && !enable) { | 384 } else if (currently_enabled && !enable) { |
| 385 service()->DisableExtension(extension_id_); | 385 service()->DisableExtension(extension_id_, Extension::DISABLE_USER_ACTION); |
| 386 } | 386 } |
| 387 | 387 |
| 388 BrowserThread::PostTask( | 388 BrowserThread::PostTask( |
| 389 BrowserThread::UI, | 389 BrowserThread::UI, |
| 390 FROM_HERE, | 390 FROM_HERE, |
| 391 base::Bind(&SetEnabledFunction::SendResponse, this, true)); | 391 base::Bind(&SetEnabledFunction::SendResponse, this, true)); |
| 392 | 392 |
| 393 return true; | 393 return true; |
| 394 } | 394 } |
| 395 | 395 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 ExtensionService* service = profile->GetExtensionService(); | 492 ExtensionService* service = profile->GetExtensionService(); |
| 493 args.Append(CreateExtensionInfo(*extension, service)); | 493 args.Append(CreateExtensionInfo(*extension, service)); |
| 494 } | 494 } |
| 495 | 495 |
| 496 std::string args_json; | 496 std::string args_json; |
| 497 base::JSONWriter::Write(&args, &args_json); | 497 base::JSONWriter::Write(&args, &args_json); |
| 498 | 498 |
| 499 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 499 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 500 event_name, args_json, NULL, GURL()); | 500 event_name, args_json, NULL, GURL()); |
| 501 } | 501 } |
| OLD | NEW |