OLD | NEW |
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/extension_install_ui.h" | 5 #include "chrome/browser/extensions/extension_install_ui.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 IntToString16(hosts.size() - 2))); | 102 IntToString16(hosts.size() - 2))); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 if (extension->HasEffectiveBrowsingHistoryPermission()) { | 106 if (extension->HasEffectiveBrowsingHistoryPermission()) { |
107 warnings->push_back( | 107 warnings->push_back( |
108 l10n_util::GetStringUTF16( | 108 l10n_util::GetStringUTF16( |
109 IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY)); | 109 IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY)); |
110 } | 110 } |
111 | 111 |
112 if (extension->HasApiPermission(Extension::kGeolocationPermission)) { | 112 const Extension::SimplePermissions& simple_permissions = |
113 warnings->push_back(l10n_util::GetStringUTF16( | 113 Extension::GetSimplePermissions(); |
114 IDS_EXTENSION_PROMPT2_WARNING_GEOLOCATION)); | 114 |
| 115 for (Extension::SimplePermissions::const_iterator iter = |
| 116 simple_permissions.begin(); |
| 117 iter != simple_permissions.end(); ++iter) { |
| 118 if (extension->HasApiPermission(iter->first)) |
| 119 warnings->push_back(iter->second); |
115 } | 120 } |
116 | |
117 // TODO(aa): camera/mic, what else? | |
118 } | 121 } |
119 | 122 |
120 } // namespace | 123 } // namespace |
121 | 124 |
122 ExtensionInstallUI::ExtensionInstallUI(Profile* profile) | 125 ExtensionInstallUI::ExtensionInstallUI(Profile* profile) |
123 : profile_(profile), | 126 : profile_(profile), |
124 ui_loop_(MessageLoop::current()), | 127 ui_loop_(MessageLoop::current()), |
125 previous_use_system_theme_(false), | 128 previous_use_system_theme_(false), |
126 extension_(NULL), | 129 extension_(NULL), |
127 delegate_(NULL), | 130 delegate_(NULL), |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 TabContents* tab_contents, Extension* new_theme, | 362 TabContents* tab_contents, Extension* new_theme, |
360 const std::string& previous_theme_id, bool previous_use_system_theme) { | 363 const std::string& previous_theme_id, bool previous_use_system_theme) { |
361 #if defined(TOOLKIT_GTK) | 364 #if defined(TOOLKIT_GTK) |
362 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 365 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
363 previous_theme_id, previous_use_system_theme); | 366 previous_theme_id, previous_use_system_theme); |
364 #else | 367 #else |
365 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 368 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
366 previous_theme_id); | 369 previous_theme_id); |
367 #endif | 370 #endif |
368 } | 371 } |
OLD | NEW |