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

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

Issue 2855009: Only allow installation of extensions/apps with gallery update url via download from gallery (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: name change Created 10 years, 6 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions_ui.h" 5 #include "chrome/browser/extensions/extensions_ui.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/google_util.h" 25 #include "chrome/browser/google_util.h"
26 #include "chrome/browser/pref_service.h" 26 #include "chrome/browser/pref_service.h"
27 #include "chrome/browser/profile.h" 27 #include "chrome/browser/profile.h"
28 #include "chrome/browser/renderer_host/render_process_host.h" 28 #include "chrome/browser/renderer_host/render_process_host.h"
29 #include "chrome/browser/renderer_host/render_widget_host.h" 29 #include "chrome/browser/renderer_host/render_widget_host.h"
30 #include "chrome/browser/renderer_host/render_view_host.h" 30 #include "chrome/browser/renderer_host/render_view_host.h"
31 #include "chrome/browser/tab_contents/tab_contents.h" 31 #include "chrome/browser/tab_contents/tab_contents.h"
32 #include "chrome/browser/tab_contents/tab_contents_view.h" 32 #include "chrome/browser/tab_contents/tab_contents_view.h"
33 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/extensions/extension.h" 34 #include "chrome/common/extensions/extension.h"
35 #include "chrome/common/extensions/extension_constants.h"
36 #include "chrome/common/extensions/user_script.h" 35 #include "chrome/common/extensions/user_script.h"
37 #include "chrome/common/extensions/url_pattern.h" 36 #include "chrome/common/extensions/url_pattern.h"
38 #include "chrome/common/jstemplate_builder.h" 37 #include "chrome/common/jstemplate_builder.h"
39 #include "chrome/common/notification_service.h" 38 #include "chrome/common/notification_service.h"
40 #include "chrome/common/notification_type.h" 39 #include "chrome/common/notification_type.h"
41 #include "chrome/common/pref_names.h" 40 #include "chrome/common/pref_names.h"
42 #include "chrome/common/url_constants.h" 41 #include "chrome/common/url_constants.h"
43 #include "gfx/codec/png_codec.h" 42 #include "gfx/codec/png_codec.h"
44 #include "gfx/color_utils.h" 43 #include "gfx/color_utils.h"
45 #include "gfx/skbitmap_operations.h" 44 #include "gfx/skbitmap_operations.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 localized_strings.SetString(L"packButton", 91 localized_strings.SetString(L"packButton",
93 l10n_util::GetString(IDS_EXTENSIONS_PACK_BUTTON)); 92 l10n_util::GetString(IDS_EXTENSIONS_PACK_BUTTON));
94 localized_strings.SetString(L"updateButton", 93 localized_strings.SetString(L"updateButton",
95 l10n_util::GetString(IDS_EXTENSIONS_UPDATE_BUTTON)); 94 l10n_util::GetString(IDS_EXTENSIONS_UPDATE_BUTTON));
96 localized_strings.SetString(L"noExtensions", 95 localized_strings.SetString(L"noExtensions",
97 l10n_util::GetString(IDS_EXTENSIONS_NONE_INSTALLED)); 96 l10n_util::GetString(IDS_EXTENSIONS_NONE_INSTALLED));
98 localized_strings.SetString(L"suggestGallery", 97 localized_strings.SetString(L"suggestGallery",
99 l10n_util::GetStringF(IDS_EXTENSIONS_NONE_INSTALLED_SUGGEST_GALLERY, 98 l10n_util::GetStringF(IDS_EXTENSIONS_NONE_INSTALLED_SUGGEST_GALLERY,
100 std::wstring(L"<a href='") + 99 std::wstring(L"<a href='") +
101 ASCIIToWide(google_util::AppendGoogleLocaleParam( 100 ASCIIToWide(google_util::AppendGoogleLocaleParam(
102 GURL(extension_urls::kGalleryBrowsePrefix)).spec()) + L"'>", 101 GURL(Extension::ChromeStoreURL())).spec()) + L"'>",
103 L"</a>")); 102 L"</a>"));
104 localized_strings.SetString(L"getMoreExtensions", 103 localized_strings.SetString(L"getMoreExtensions",
105 std::wstring(L"<a href='") + 104 std::wstring(L"<a href='") +
106 ASCIIToWide(google_util::AppendGoogleLocaleParam( 105 ASCIIToWide(google_util::AppendGoogleLocaleParam(
107 GURL(extension_urls::kGalleryBrowsePrefix)).spec()) + L"'>" + 106 GURL(Extension::ChromeStoreURL())).spec()) + L"'>" +
108 l10n_util::GetString(IDS_GET_MORE_EXTENSIONS) + 107 l10n_util::GetString(IDS_GET_MORE_EXTENSIONS) +
109 L"</a>"); 108 L"</a>");
110 localized_strings.SetString(L"extensionDisabled", 109 localized_strings.SetString(L"extensionDisabled",
111 l10n_util::GetString(IDS_EXTENSIONS_DISABLED_EXTENSION)); 110 l10n_util::GetString(IDS_EXTENSIONS_DISABLED_EXTENSION));
112 localized_strings.SetString(L"inDevelopment", 111 localized_strings.SetString(L"inDevelopment",
113 l10n_util::GetString(IDS_EXTENSIONS_IN_DEVELOPMENT)); 112 l10n_util::GetString(IDS_EXTENSIONS_IN_DEVELOPMENT));
114 localized_strings.SetString(L"extensionId", 113 localized_strings.SetString(L"extensionId",
115 l10n_util::GetString(IDS_EXTENSIONS_ID)); 114 l10n_util::GetString(IDS_EXTENSIONS_ID));
116 localized_strings.SetString(L"extensionVersion", 115 localized_strings.SetString(L"extensionVersion",
117 l10n_util::GetString(IDS_EXTENSIONS_VERSION)); 116 l10n_util::GetString(IDS_EXTENSIONS_VERSION));
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 // static 893 // static
895 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { 894 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() {
896 return ResourceBundle::GetSharedInstance(). 895 return ResourceBundle::GetSharedInstance().
897 LoadDataResourceBytes(IDR_PLUGIN); 896 LoadDataResourceBytes(IDR_PLUGIN);
898 } 897 }
899 898
900 // static 899 // static
901 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { 900 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) {
902 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); 901 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false);
903 } 902 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698