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

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

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 bool currently_enabled = service()->IsExtensionEnabled(extension_id_); 401 bool currently_enabled = service()->IsExtensionEnabled(extension_id_);
402 402
403 if (!currently_enabled && enable) { 403 if (!currently_enabled && enable) {
404 ExtensionPrefs* prefs = service()->extension_prefs(); 404 ExtensionPrefs* prefs = service()->extension_prefs();
405 if (prefs->DidExtensionEscalatePermissions(extension_id_)) { 405 if (prefs->DidExtensionEscalatePermissions(extension_id_)) {
406 if (!user_gesture()) { 406 if (!user_gesture()) {
407 error_ = keys::kGestureNeededForEscalationError; 407 error_ = keys::kGestureNeededForEscalationError;
408 return false; 408 return false;
409 } 409 }
410 AddRef(); // Matched in InstallUIProceed/InstallUIAbort 410 AddRef(); // Matched in InstallUIProceed/InstallUIAbort
411 install_prompt_.reset(new ExtensionInstallPrompt(GetCurrentBrowser())); 411 install_prompt_.reset(
412 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser()));
412 install_prompt_->ConfirmReEnable(this, extension); 413 install_prompt_->ConfirmReEnable(this, extension);
413 return true; 414 return true;
414 } 415 }
415 service()->EnableExtension(extension_id_); 416 service()->EnableExtension(extension_id_);
416 } else if (currently_enabled && !enable) { 417 } else if (currently_enabled && !enable) {
417 service()->DisableExtension(extension_id_, Extension::DISABLE_USER_ACTION); 418 service()->DisableExtension(extension_id_, Extension::DISABLE_USER_ACTION);
418 } 419 }
419 420
420 BrowserThread::PostTask( 421 BrowserThread::PostTask(
421 BrowserThread::UI, 422 BrowserThread::UI,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 ExtensionService* service = profile->GetExtensionService(); 585 ExtensionService* service = profile->GetExtensionService();
585 args.Append(CreateExtensionInfo(*extension, service)); 586 args.Append(CreateExtensionInfo(*extension, service));
586 } 587 }
587 588
588 std::string args_json; 589 std::string args_json;
589 base::JSONWriter::Write(&args, &args_json); 590 base::JSONWriter::Write(&args, &args_json);
590 591
591 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 592 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
592 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); 593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo());
593 } 594 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_ui_default.cc ('k') | chrome/browser/extensions/extension_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698