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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/extensions/extension_install_dialog.h" 15 #include "chrome/browser/extensions/extension_install_dialog.h"
16 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" 16 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
17 #include "chrome/browser/platform_util.h" 17 #include "chrome/browser/platform_util.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/tabs/tab_strip_model.h" 19 #include "chrome/browser/tabs/tab_strip_model.h"
20 #include "chrome/browser/themes/theme_service.h" 20 #include "chrome/browser/themes/theme_service.h"
21 #include "chrome/browser/themes/theme_service_factory.h" 21 #include "chrome/browser/themes/theme_service_factory.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_dialogs.h" 23 #include "chrome/browser/ui/browser_dialogs.h"
24 #include "chrome/browser/ui/browser_list.h" 24 #include "chrome/browser/ui/browser_list.h"
25 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
27 #include "chrome/common/chrome_notification_types.h"
27 #include "chrome/common/extensions/extension.h" 28 #include "chrome/common/extensions/extension.h"
28 #include "chrome/common/extensions/extension_icon_set.h" 29 #include "chrome/common/extensions/extension_icon_set.h"
29 #include "chrome/common/extensions/extension_resource.h" 30 #include "chrome/common/extensions/extension_resource.h"
30 #include "chrome/common/extensions/url_pattern.h" 31 #include "chrome/common/extensions/url_pattern.h"
31 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
32 #include "content/common/notification_service.h" 33 #include "content/common/notification_service.h"
33 #include "grit/chromium_strings.h" 34 #include "grit/chromium_strings.h"
34 #include "grit/generated_resources.h" 35 #include "grit/generated_resources.h"
35 #include "grit/theme_resources.h" 36 #include "grit/theme_resources.h"
36 #include "ui/base/l10n/l10n_util.h" 37 #include "ui/base/l10n/l10n_util.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void ExtensionInstallUI::OnImageLoaded( 191 void ExtensionInstallUI::OnImageLoaded(
191 SkBitmap* image, const ExtensionResource& resource, int index) { 192 SkBitmap* image, const ExtensionResource& resource, int index) {
192 SetIcon(image); 193 SetIcon(image);
193 194
194 switch (prompt_type_) { 195 switch (prompt_type_) {
195 case RE_ENABLE_PROMPT: 196 case RE_ENABLE_PROMPT:
196 case INSTALL_PROMPT: { 197 case INSTALL_PROMPT: {
197 // TODO(jcivelli): http://crbug.com/44771 We should not show an install 198 // TODO(jcivelli): http://crbug.com/44771 We should not show an install
198 // dialog when installing an app from the gallery. 199 // dialog when installing an app from the gallery.
199 NotificationService* service = NotificationService::current(); 200 NotificationService* service = NotificationService::current();
200 service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, 201 service->Notify(chrome::NOTIFICATION_EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
201 Source<ExtensionInstallUI>(this), 202 Source<ExtensionInstallUI>(this),
202 NotificationService::NoDetails()); 203 NotificationService::NoDetails());
203 204
204 std::vector<string16> warnings = 205 std::vector<string16> warnings =
205 extension_->GetPermissionMessageStrings(); 206 extension_->GetPermissionMessageStrings();
206 ShowExtensionInstallDialog( 207 ShowExtensionInstallDialog(
207 profile_, delegate_, extension_, &icon_, warnings, prompt_type_); 208 profile_, delegate_, extension_, &icon_, warnings, prompt_type_);
208 break; 209 break;
209 } 210 }
210 default: 211 default:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 276
276 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate( 277 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate(
277 TabContents* tab_contents, 278 TabContents* tab_contents,
278 const Extension* new_theme, 279 const Extension* new_theme,
279 const std::string& previous_theme_id, 280 const std::string& previous_theme_id,
280 bool previous_using_native_theme) { 281 bool previous_using_native_theme) {
281 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, 282 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme,
282 previous_theme_id, 283 previous_theme_id,
283 previous_using_native_theme); 284 previous_using_native_theme);
284 } 285 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_input_api.cc ('k') | chrome/browser/extensions/extension_management_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698