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

Side by Side Diff: chrome/browser/extensions/api/management/management_api.cc

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the BrowserFinder method, and kept the dialog unconstructed until it's shown Created 6 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/api/management/management_api.h" 5 #include "chrome/browser/extensions/api/management/management_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 ->UserMayModifySettings(target_extension, NULL)) { 604 ->UserMayModifySettings(target_extension, NULL)) {
605 error_ = ErrorUtils::FormatErrorMessage( 605 error_ = ErrorUtils::FormatErrorMessage(
606 keys::kUserCantModifyError, extension_id_); 606 keys::kUserCantModifyError, extension_id_);
607 return false; 607 return false;
608 } 608 }
609 609
610 if (auto_confirm_for_test == DO_NOT_SKIP) { 610 if (auto_confirm_for_test == DO_NOT_SKIP) {
611 if (show_confirm_dialog) { 611 if (show_confirm_dialog) {
612 AddRef(); // Balanced in ExtensionUninstallAccepted/Canceled 612 AddRef(); // Balanced in ExtensionUninstallAccepted/Canceled
613 extension_uninstall_dialog_.reset(ExtensionUninstallDialog::Create( 613 extension_uninstall_dialog_.reset(ExtensionUninstallDialog::Create(
614 GetProfile(), GetCurrentBrowser(), this)); 614 GetProfile(),
615 GetCurrentBrowser()->window()->GetNativeWindow(),
tapted 2014/07/24 07:09:55 So.. I think there's a pre-existing crash lurking
sashab 2014/07/24 08:02:14 Nice! Done. kalman: Is this the crash you were ta
616 this));
615 if (extension_id() != target_extension_id) { 617 if (extension_id() != target_extension_id) {
616 extension_uninstall_dialog_->ConfirmProgrammaticUninstall( 618 extension_uninstall_dialog_->ConfirmProgrammaticUninstall(
617 target_extension, GetExtension()); 619 target_extension, GetExtension());
618 } else { 620 } else {
619 // If this is a self uninstall, show the generic uninstall dialog. 621 // If this is a self uninstall, show the generic uninstall dialog.
620 extension_uninstall_dialog_->ConfirmUninstall(target_extension); 622 extension_uninstall_dialog_->ConfirmUninstall(target_extension);
621 } 623 }
622 } else { 624 } else {
623 Finish(true); 625 Finish(true);
624 } 626 }
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 ManagementAPI::GetFactoryInstance() { 1001 ManagementAPI::GetFactoryInstance() {
1000 return g_factory.Pointer(); 1002 return g_factory.Pointer();
1001 } 1003 }
1002 1004
1003 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { 1005 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) {
1004 management_event_router_.reset(new ManagementEventRouter(browser_context_)); 1006 management_event_router_.reset(new ManagementEventRouter(browser_context_));
1005 EventRouter::Get(browser_context_)->UnregisterObserver(this); 1007 EventRouter::Get(browser_context_)->UnregisterObserver(this);
1006 } 1008 }
1007 1009
1008 } // namespace extensions 1010 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698