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/ui/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/metrics_names.h" | 9 #include "apps/metrics_names.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 extension->GetType()); | 511 extension->GetType()); |
512 } else { | 512 } else { |
513 CoreAppLauncherHandler::RecordWebStoreLaunch(); | 513 CoreAppLauncherHandler::RecordWebStoreLaunch(); |
514 } | 514 } |
515 | 515 |
516 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB || | 516 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB || |
517 disposition == NEW_WINDOW) { | 517 disposition == NEW_WINDOW) { |
518 // TODO(jamescook): Proper support for background tabs. | 518 // TODO(jamescook): Proper support for background tabs. |
519 AppLaunchParams params(profile, extension, | 519 AppLaunchParams params(profile, extension, |
520 disposition == NEW_WINDOW ? | 520 disposition == NEW_WINDOW ? |
521 extensions::LAUNCH_WINDOW : | 521 extensions::LAUNCH_CONTAINER_WINDOW : |
522 extensions::LAUNCH_TAB, | 522 extensions::LAUNCH_CONTAINER_TAB, |
523 disposition); | 523 disposition); |
524 params.override_url = GURL(url); | 524 params.override_url = GURL(url); |
525 OpenApplication(params); | 525 OpenApplication(params); |
526 } else { | 526 } else { |
527 // To give a more "launchy" experience when using the NTP launcher, we close | 527 // To give a more "launchy" experience when using the NTP launcher, we close |
528 // it automatically. | 528 // it automatically. |
529 Browser* browser = chrome::FindBrowserWithWebContents( | 529 Browser* browser = chrome::FindBrowserWithWebContents( |
530 web_ui()->GetWebContents()); | 530 web_ui()->GetWebContents()); |
531 WebContents* old_contents = NULL; | 531 WebContents* old_contents = NULL; |
532 if (browser) | 532 if (browser) |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 839 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
840 if (!extension_uninstall_dialog_.get()) { | 840 if (!extension_uninstall_dialog_.get()) { |
841 Browser* browser = chrome::FindBrowserWithWebContents( | 841 Browser* browser = chrome::FindBrowserWithWebContents( |
842 web_ui()->GetWebContents()); | 842 web_ui()->GetWebContents()); |
843 extension_uninstall_dialog_.reset( | 843 extension_uninstall_dialog_.reset( |
844 ExtensionUninstallDialog::Create(extension_service_->profile(), | 844 ExtensionUninstallDialog::Create(extension_service_->profile(), |
845 browser, this)); | 845 browser, this)); |
846 } | 846 } |
847 return extension_uninstall_dialog_.get(); | 847 return extension_uninstall_dialog_.get(); |
848 } | 848 } |
OLD | NEW |