OLD | NEW |
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/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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/simple_message_box.h" | 21 #include "chrome/browser/simple_message_box.h" |
22 #include "chrome/browser/tabs/tab_strip_model.h" | 22 #include "chrome/browser/tabs/tab_strip_model.h" |
23 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
24 #include "chrome/browser/themes/theme_service_factory.h" | 24 #include "chrome/browser/themes/theme_service_factory.h" |
25 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
26 #include "chrome/browser/ui/browser_dialogs.h" | 26 #include "chrome/browser/ui/browser_dialogs.h" |
27 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
28 #include "chrome/browser/ui/browser_navigator.h" | 28 #include "chrome/browser/ui/browser_navigator.h" |
29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
30 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 30 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 31 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
31 #include "chrome/common/chrome_notification_types.h" | 32 #include "chrome/common/chrome_notification_types.h" |
32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
34 #include "chrome/common/extensions/extension_icon_set.h" | 35 #include "chrome/common/extensions/extension_icon_set.h" |
35 #include "chrome/common/extensions/extension_resource.h" | 36 #include "chrome/common/extensions/extension_resource.h" |
36 #include "chrome/common/extensions/url_pattern.h" | 37 #include "chrome/common/extensions/url_pattern.h" |
37 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
39 #include "grit/chromium_strings.h" | 40 #include "grit/chromium_strings.h" |
40 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 browser->window()->Show(); | 292 browser->window()->Show(); |
292 | 293 |
293 bool use_bubble_for_apps = false; | 294 bool use_bubble_for_apps = false; |
294 | 295 |
295 #if defined(TOOLKIT_VIEWS) | 296 #if defined(TOOLKIT_VIEWS) |
296 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 297 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
297 use_bubble_for_apps = (use_app_installed_bubble_ || | 298 use_bubble_for_apps = (use_app_installed_bubble_ || |
298 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); | 299 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); |
299 #endif | 300 #endif |
300 | 301 |
301 if (extension->is_app() && !use_bubble_for_apps) { | 302 if (extension->is_app() && |
| 303 !use_bubble_for_apps && |
| 304 NewTabUI::ShouldShowAppsPage()) { |
302 ExtensionInstallUI::OpenAppInstalledNTP(browser, extension->id()); | 305 ExtensionInstallUI::OpenAppInstalledNTP(browser, extension->id()); |
303 return; | 306 return; |
304 } | 307 } |
305 | 308 |
306 browser::ShowExtensionInstalledBubble(extension, browser, icon_, profile); | 309 browser::ShowExtensionInstalledBubble(extension, browser, icon_, profile); |
307 } | 310 } |
308 | 311 |
309 namespace { | 312 namespace { |
310 | 313 |
311 bool disable_failure_ui_for_tests = false; | 314 bool disable_failure_ui_for_tests = false; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 bool previous_using_native_theme) { | 444 bool previous_using_native_theme) { |
442 Profile* profile = tab_contents->profile(); | 445 Profile* profile = tab_contents->profile(); |
443 return new ThemeInstalledInfoBarDelegate( | 446 return new ThemeInstalledInfoBarDelegate( |
444 tab_contents->infobar_tab_helper(), | 447 tab_contents->infobar_tab_helper(), |
445 profile->GetExtensionService(), | 448 profile->GetExtensionService(), |
446 ThemeServiceFactory::GetForProfile(profile), | 449 ThemeServiceFactory::GetForProfile(profile), |
447 new_theme, | 450 new_theme, |
448 previous_theme_id, | 451 previous_theme_id, |
449 previous_using_native_theme); | 452 previous_using_native_theme); |
450 } | 453 } |
OLD | NEW |