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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 668163002: Enabled the App Info dialog on the Extensions page by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Histograms file fix Created 6 years, 2 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | extensions/common/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/saved_files_service.h" 8 #include "apps/saved_files_service.h"
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #include "grit/components_strings.h" 101 #include "grit/components_strings.h"
102 #include "grit/theme_resources.h" 102 #include "grit/theme_resources.h"
103 #include "ui/base/l10n/l10n_util.h" 103 #include "ui/base/l10n/l10n_util.h"
104 104
105 using base::DictionaryValue; 105 using base::DictionaryValue;
106 using base::ListValue; 106 using base::ListValue;
107 using content::RenderViewHost; 107 using content::RenderViewHost;
108 using content::WebContents; 108 using content::WebContents;
109 109
110 namespace { 110 namespace {
111
111 const char kAppsDeveloperToolsExtensionId[] = 112 const char kAppsDeveloperToolsExtensionId[] =
112 "ohmmkhmmmpcnpikjeljgnaoabkaalbgc"; 113 "ohmmkhmmmpcnpikjeljgnaoabkaalbgc";
114
115 // Returns true if the extensions page should display the new-style extension
116 // info dialog. If false, display the old permissions dialog.
117 bool ShouldDisplayExtensionInfoDialog() {
118 bool display_extension_info_dialog = false;
benwells 2014/10/23 00:43:16 super nit: this would be simpler logically as #if
sashab 2014/10/23 06:34:36 Done.
119 #if !defined(OS_MACOSX)
120 display_extension_info_dialog =
121 !base::CommandLine::ForCurrentProcess()->HasSwitch(
122 extensions::switches::kDisableExtensionInfoDialog);
123 #endif
124 return display_extension_info_dialog;
113 } 125 }
114 126
127 } // namespace
128
115 namespace extensions { 129 namespace extensions {
116 130
117 ExtensionPage::ExtensionPage(const GURL& url, 131 ExtensionPage::ExtensionPage(const GURL& url,
118 int render_process_id, 132 int render_process_id,
119 int render_view_id, 133 int render_view_id,
120 bool incognito, 134 bool incognito,
121 bool generated_background_page) 135 bool generated_background_page)
122 : url(url), 136 : url(url),
123 render_process_id(render_process_id), 137 render_process_id(render_process_id),
124 render_view_id(render_view_id), 138 render_view_id(render_view_id),
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 source->AddString("extensionSettingsReloadTerminated", 544 source->AddString("extensionSettingsReloadTerminated",
531 l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_TERMINATED)); 545 l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_TERMINATED));
532 source->AddString("extensionSettingsRepairCorrupted", 546 source->AddString("extensionSettingsRepairCorrupted",
533 l10n_util::GetStringUTF16(IDS_EXTENSIONS_REPAIR_CORRUPTED)); 547 l10n_util::GetStringUTF16(IDS_EXTENSIONS_REPAIR_CORRUPTED));
534 source->AddString("extensionSettingsLaunch", 548 source->AddString("extensionSettingsLaunch",
535 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LAUNCH)); 549 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LAUNCH));
536 source->AddString("extensionSettingsReloadUnpacked", 550 source->AddString("extensionSettingsReloadUnpacked",
537 l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_UNPACKED)); 551 l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_UNPACKED));
538 source->AddString("extensionSettingsOptions", 552 source->AddString("extensionSettingsOptions",
539 l10n_util::GetStringUTF16(IDS_EXTENSIONS_OPTIONS_LINK)); 553 l10n_util::GetStringUTF16(IDS_EXTENSIONS_OPTIONS_LINK));
540 if (CommandLine::ForCurrentProcess()->HasSwitch( 554 if (ShouldDisplayExtensionInfoDialog()) {
541 switches::kEnableExtensionInfoDialog)) {
542 source->AddString("extensionSettingsPermissions", 555 source->AddString("extensionSettingsPermissions",
543 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INFO_LINK)); 556 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INFO_LINK));
544 } else { 557 } else {
545 source->AddString( 558 source->AddString(
546 "extensionSettingsPermissions", 559 "extensionSettingsPermissions",
547 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PERMISSIONS_LINK)); 560 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PERMISSIONS_LINK));
548 } 561 }
549 source->AddString("extensionSettingsVisitWebsite", 562 source->AddString("extensionSettingsVisitWebsite",
550 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE)); 563 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE));
551 source->AddString("extensionSettingsVisitWebStore", 564 source->AddString("extensionSettingsVisitWebStore",
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 if (!extension) 1205 if (!extension)
1193 return; 1206 return;
1194 1207
1195 if (!extension_id_prompting_.empty()) 1208 if (!extension_id_prompting_.empty())
1196 return; // Only one prompt at a time. 1209 return; // Only one prompt at a time.
1197 1210
1198 extension_id_prompting_ = extension->id(); 1211 extension_id_prompting_ = extension->id();
1199 1212
1200 // Show the new-style extensions dialog when the flag is set. The flag cannot 1213 // Show the new-style extensions dialog when the flag is set. The flag cannot
1201 // be set on Mac platforms. 1214 // be set on Mac platforms.
1202 if (CommandLine::ForCurrentProcess()->HasSwitch( 1215 if (ShouldDisplayExtensionInfoDialog()) {
1203 switches::kEnableExtensionInfoDialog)) {
1204 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", 1216 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches",
1205 AppInfoLaunchSource::FROM_EXTENSIONS_PAGE, 1217 AppInfoLaunchSource::FROM_EXTENSIONS_PAGE,
1206 AppInfoLaunchSource::NUM_LAUNCH_SOURCES); 1218 AppInfoLaunchSource::NUM_LAUNCH_SOURCES);
1207 1219
1208 // Display the dialog at a size similar to the app list. 1220 // Display the dialog at a size similar to the app list.
1209 const int kAppInfoDialogWidth = 380; 1221 const int kAppInfoDialogWidth = 380;
1210 const int kAppInfoDialogHeight = 490; 1222 const int kAppInfoDialogHeight = 490;
1211 ShowAppInfoInNativeDialog( 1223 ShowAppInfoInNativeDialog(
1212 web_contents()->GetTopLevelNativeWindow(), 1224 web_contents()->GetTopLevelNativeWindow(),
1213 gfx::Size(kAppInfoDialogWidth, kAppInfoDialogHeight), 1225 gfx::Size(kAppInfoDialogWidth, kAppInfoDialogHeight),
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 extension_service_->EnableExtension(extension_id); 1511 extension_service_->EnableExtension(extension_id);
1500 } else { 1512 } else {
1501 ExtensionErrorReporter::GetInstance()->ReportError( 1513 ExtensionErrorReporter::GetInstance()->ReportError(
1502 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1514 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1503 true); // Be noisy. 1515 true); // Be noisy.
1504 } 1516 }
1505 requirements_checker_.reset(); 1517 requirements_checker_.reset();
1506 } 1518 }
1507 1519
1508 } // namespace extensions 1520 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | extensions/common/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698