OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_management_api_delegat e.h" | 5 #include "chrome/browser/extensions/api/management/chrome_management_api_delegat e.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/bookmark_app_helper.h" | 8 #include "chrome/browser/extensions/bookmark_app_helper.h" |
9 #include "chrome/browser/extensions/chrome_requirements_checker.h" | 9 #include "chrome/browser/extensions/chrome_requirements_checker.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 | 70 |
71 class ManagementUninstallFunctionUninstallDialogDelegate | 71 class ManagementUninstallFunctionUninstallDialogDelegate |
72 : public extensions::ExtensionUninstallDialog::Delegate, | 72 : public extensions::ExtensionUninstallDialog::Delegate, |
73 public extensions::UninstallDialogDelegate { | 73 public extensions::UninstallDialogDelegate { |
74 public: | 74 public: |
75 ManagementUninstallFunctionUninstallDialogDelegate( | 75 ManagementUninstallFunctionUninstallDialogDelegate( |
76 extensions::ManagementUninstallFunctionBase* function, | 76 extensions::ManagementUninstallFunctionBase* function, |
77 const extensions::Extension* target_extension, | 77 const extensions::Extension* target_extension, |
78 bool show_programmatic_uninstall_ui) | 78 bool show_programmatic_uninstall_ui) |
79 : function_(function) { | 79 : function_(function) { |
80 content::WebContents* web_contents = function->GetSenderWebContents(); | 80 Profile* profile = Profile::FromBrowserContext(function->browser_context()); |
81 Browser* browser = chrome::FindBrowserWithProfile( | |
82 profile, chrome::HOST_DESKTOP_TYPE_NATIVE); | |
not at google - send to devlin
2015/07/08 20:40:40
Looks like you're not supposed to hard-code this e
wjywbs
2015/07/08 23:01:21
Done.
| |
81 extension_uninstall_dialog_.reset( | 83 extension_uninstall_dialog_.reset( |
82 extensions::ExtensionUninstallDialog::Create( | 84 extensions::ExtensionUninstallDialog::Create( |
83 Profile::FromBrowserContext(function->browser_context()), | 85 profile, browser->window()->GetNativeWindow(), this)); |
not at google - send to devlin
2015/07/08 20:40:41
I think it's better to at least try to show it in
wjywbs
2015/07/08 23:01:21
Done.
| |
84 web_contents ? web_contents->GetTopLevelNativeWindow() : nullptr, | |
85 this)); | |
86 if (show_programmatic_uninstall_ui) { | 86 if (show_programmatic_uninstall_ui) { |
87 extension_uninstall_dialog_->ConfirmUninstallByExtension( | 87 extension_uninstall_dialog_->ConfirmUninstallByExtension( |
88 target_extension, function->extension(), | 88 target_extension, function->extension(), |
89 extensions::UNINSTALL_REASON_MANAGEMENT_API); | 89 extensions::UNINSTALL_REASON_MANAGEMENT_API); |
90 } else { | 90 } else { |
91 extension_uninstall_dialog_->ConfirmUninstall( | 91 extension_uninstall_dialog_->ConfirmUninstall( |
92 target_extension, extensions::UNINSTALL_REASON_MANAGEMENT_API); | 92 target_extension, extensions::UNINSTALL_REASON_MANAGEMENT_API); |
93 } | 93 } |
94 } | 94 } |
95 ~ManagementUninstallFunctionUninstallDialogDelegate() override {} | 95 ~ManagementUninstallFunctionUninstallDialogDelegate() override {} |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 | 310 |
311 GURL ChromeManagementAPIDelegate::GetIconURL( | 311 GURL ChromeManagementAPIDelegate::GetIconURL( |
312 const extensions::Extension* extension, | 312 const extensions::Extension* extension, |
313 int icon_size, | 313 int icon_size, |
314 ExtensionIconSet::MatchType match, | 314 ExtensionIconSet::MatchType match, |
315 bool grayscale, | 315 bool grayscale, |
316 bool* exists) const { | 316 bool* exists) const { |
317 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, | 317 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, |
318 match, grayscale, exists); | 318 match, grayscale, exists); |
319 } | 319 } |
OLD | NEW |