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_install_prompt.h" | 5 #include "chrome/browser/extensions/extension_install_prompt.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 Delegate* delegate, | 662 Delegate* delegate, |
663 const Extension* extension, | 663 const Extension* extension, |
664 const SkBitmap* icon, | 664 const SkBitmap* icon, |
665 scoped_ptr<Prompt> prompt, | 665 scoped_ptr<Prompt> prompt, |
666 scoped_ptr<const PermissionSet> custom_permissions, | 666 scoped_ptr<const PermissionSet> custom_permissions, |
667 const ShowDialogCallback& show_dialog_callback) { | 667 const ShowDialogCallback& show_dialog_callback) { |
668 DCHECK(ui_loop_ == base::MessageLoop::current()); | 668 DCHECK(ui_loop_ == base::MessageLoop::current()); |
669 DCHECK(prompt); | 669 DCHECK(prompt); |
670 extension_ = extension; | 670 extension_ = extension; |
671 delegate_ = delegate; | 671 delegate_ = delegate; |
672 SetIcon(icon); | 672 if (icon && !icon->empty()) |
673 SetIcon(icon); | |
Devlin
2015/12/17 22:21:14
D'oh. Forgot that SetIcon() sets the default if |
| |
673 prompt_ = prompt.Pass(); | 674 prompt_ = prompt.Pass(); |
674 custom_permissions_ = custom_permissions.Pass(); | 675 custom_permissions_ = custom_permissions.Pass(); |
675 show_dialog_callback_ = show_dialog_callback; | 676 show_dialog_callback_ = show_dialog_callback; |
676 | 677 |
677 // We special-case themes to not show any confirm UI. Instead they are | 678 // We special-case themes to not show any confirm UI. Instead they are |
678 // immediately installed, and then we show an infobar (see OnInstallSuccess) | 679 // immediately installed, and then we show an infobar (see OnInstallSuccess) |
679 // to allow the user to revert if they don't like it. | 680 // to allow the user to revert if they don't like it. |
680 // | 681 // |
681 // We don't do this in the case where off-store extension installs are | 682 // We don't do this in the case where off-store extension installs are |
682 // disabled because in that case, we don't show the dangerous download UI, so | 683 // disabled because in that case, we don't show the dangerous download UI, so |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
836 delegate_->InstallUIAbort(false); | 837 delegate_->InstallUIAbort(false); |
837 return; | 838 return; |
838 } | 839 } |
839 | 840 |
840 if (show_dialog_callback_.is_null()) | 841 if (show_dialog_callback_.is_null()) |
841 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, | 842 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, |
842 prompt_.Pass()); | 843 prompt_.Pass()); |
843 else | 844 else |
844 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_.Pass()); | 845 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_.Pass()); |
845 } | 846 } |
OLD | NEW |