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

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

Issue 1010953002: [Extensions] Add support for reporting abuse on extension uninstallation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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_uninstall_dialog.h" 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/extensions/extension_util.h" 11 #include "chrome/browser/extensions/extension_util.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser_navigator.h"
13 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
14 #include "extensions/browser/extension_registry.h" 15 #include "extensions/browser/extension_registry.h"
15 #include "extensions/browser/image_loader.h" 16 #include "extensions/browser/image_loader.h"
16 #include "extensions/common/constants.h" 17 #include "extensions/common/constants.h"
17 #include "extensions/common/extension.h" 18 #include "extensions/common/extension.h"
18 #include "extensions/common/extension_icon_set.h" 19 #include "extensions/common/extension_icon_set.h"
19 #include "extensions/common/extension_resource.h" 20 #include "extensions/common/extension_resource.h"
21 #include "extensions/common/extension_urls.h"
20 #include "extensions/common/manifest_handlers/icons_handler.h" 22 #include "extensions/common/manifest_handlers/icons_handler.h"
21 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/page_transition_types.h"
25 #include "ui/base/window_open_disposition.h"
22 #include "ui/gfx/image/image.h" 26 #include "ui/gfx/image/image.h"
23 #include "ui/gfx/image/image_skia.h" 27 #include "ui/gfx/image/image_skia.h"
24 28
25 namespace extensions { 29 namespace extensions {
26 30
27 namespace { 31 namespace {
28 32
29 // Returns bitmap for the default icon with size equal to the default icon's 33 // Returns bitmap for the default icon with size equal to the default icon's
30 // pixel size under maximal supported scale factor. 34 // pixel size under maximal supported scale factor.
31 SkBitmap GetDefaultIconBitmapForMaxScaleFactor(bool is_app) { 35 SkBitmap GetDefaultIconBitmapForMaxScaleFactor(bool is_app) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (triggering_extension_) { 120 if (triggering_extension_) {
117 return l10n_util::GetStringFUTF8( 121 return l10n_util::GetStringFUTF8(
118 IDS_EXTENSION_PROGRAMMATIC_UNINSTALL_PROMPT_HEADING, 122 IDS_EXTENSION_PROGRAMMATIC_UNINSTALL_PROMPT_HEADING,
119 base::UTF8ToUTF16(triggering_extension_->name()), 123 base::UTF8ToUTF16(triggering_extension_->name()),
120 base::UTF8ToUTF16(extension_->name())); 124 base::UTF8ToUTF16(extension_->name()));
121 } 125 }
122 return l10n_util::GetStringFUTF8(IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, 126 return l10n_util::GetStringFUTF8(IDS_EXTENSION_UNINSTALL_PROMPT_HEADING,
123 base::UTF8ToUTF16(extension_->name())); 127 base::UTF8ToUTF16(extension_->name()));
124 } 128 }
125 129
130 bool ExtensionUninstallDialog::ShouldShowReportAbuseCheckbox() const {
131 // TODO(devlin): Add a field trial for reporting abuse on uninstallation.
132 // See crbug.com/441377.
133 return false;
Finnur 2015/03/19 10:43:26 There was a concern with logged-in vs. not-logged-
Devlin 2015/03/19 15:50:42 I think Jake and I are hoping that we can just dro
134 }
135
136 void ExtensionUninstallDialog::HandleReportAbuse() {
137 chrome::NavigateParams params(
138 profile_,
139 extension_urls::GetWebstoreReportAbuseUrl(extension_->id()),
140 ui::PAGE_TRANSITION_LINK);
141 params.disposition = NEW_FOREGROUND_TAB;
142 chrome::Navigate(&params);
143 }
144
126 } // namespace extensions 145 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698