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

Side by Side Diff: chrome/browser/extensions/extension_management_api.cc

Issue 9960087: Revert 13676 - Revert 131665 - Add a preference for why an extension is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 (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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698