OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (extension->IsTheme()) { | 39 if (extension->IsTheme()) { |
40 // Remember the current theme in case the user pressed undo. | 40 // Remember the current theme in case the user pressed undo. |
41 Extension* previous_theme = profile_->GetTheme(); | 41 Extension* previous_theme = profile_->GetTheme(); |
42 if (previous_theme) | 42 if (previous_theme) |
43 previous_theme_id_ = previous_theme->id(); | 43 previous_theme_id_ = previous_theme->id(); |
44 | 44 |
45 delegate->ContinueInstall(); | 45 delegate->ContinueInstall(); |
46 return; | 46 return; |
47 } | 47 } |
48 | 48 |
49 #if defined(OS_WIN) || defined(OS_LINUX) | 49 #if defined(OS_WIN) |
50 ShowExtensionInstallPrompt(profile_, delegate, extension, install_icon); | 50 ShowExtensionInstallPrompt(profile_, delegate, extension, install_icon); |
51 | 51 |
52 #elif defined(OS_MACOSX) | 52 #elif defined(OS_MACOSX) |
53 // TODO(port): Implement nicer UI. | 53 // TODO(port): Implement nicer UI. |
54 // Using CoreFoundation to do this dialog is unimaginably lame but will do | 54 // Using CoreFoundation to do this dialog is unimaginably lame but will do |
55 // until the UI is redone. | 55 // until the UI is redone. |
56 scoped_cftyperef<CFStringRef> product_name( | 56 scoped_cftyperef<CFStringRef> product_name( |
57 base::SysWideToCFStringRef(l10n_util::GetString(IDS_PRODUCT_NAME))); | 57 base::SysWideToCFStringRef(l10n_util::GetString(IDS_PRODUCT_NAME))); |
58 CFOptionFlags response; | 58 CFOptionFlags response; |
59 if (kCFUserNotificationAlternateResponse == CFUserNotificationDisplayAlert( | 59 if (kCFUserNotificationAlternateResponse == CFUserNotificationDisplayAlert( |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // Then either replace that old one or add a new one. | 130 // Then either replace that old one or add a new one. |
131 InfoBarDelegate* new_delegate = new ThemePreviewInfobarDelegate(tab_contents, | 131 InfoBarDelegate* new_delegate = new ThemePreviewInfobarDelegate(tab_contents, |
132 new_theme->name(), previous_theme_id_); | 132 new_theme->name(), previous_theme_id_); |
133 | 133 |
134 if (old_delegate) | 134 if (old_delegate) |
135 tab_contents->ReplaceInfoBar(old_delegate, new_delegate); | 135 tab_contents->ReplaceInfoBar(old_delegate, new_delegate); |
136 else | 136 else |
137 tab_contents->AddInfoBar(new_delegate); | 137 tab_contents->AddInfoBar(new_delegate); |
138 } | 138 } |
OLD | NEW |