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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 114263005: Convert Extension* to extension id in AppLaunchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 7 years 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
OLDNEW
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/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 AppListService::InitAll(profile); 364 AppListService::InitAll(profile);
365 if (command_line_.HasSwitch(switches::kAppId)) { 365 if (command_line_.HasSwitch(switches::kAppId)) {
366 std::string app_id = command_line_.GetSwitchValueASCII(switches::kAppId); 366 std::string app_id = command_line_.GetSwitchValueASCII(switches::kAppId);
367 const Extension* extension = GetDisabledPlatformApp(profile, app_id); 367 const Extension* extension = GetDisabledPlatformApp(profile, app_id);
368 // If |app_id| is a disabled platform app we handle it specially here, 368 // If |app_id| is a disabled platform app we handle it specially here,
369 // otherwise it will be handled below. 369 // otherwise it will be handled below.
370 if (extension) { 370 if (extension) {
371 RecordCmdLineAppHistogram(extensions::Manifest::TYPE_PLATFORM_APP); 371 RecordCmdLineAppHistogram(extensions::Manifest::TYPE_PLATFORM_APP);
372 AppLaunchParams params(profile, extension, 372 AppLaunchParams params(profile, extension,
373 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW); 373 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW);
374 params.command_line = &command_line_; 374 params.command_line = command_line_;
375 params.current_directory = cur_dir_; 375 params.current_directory = cur_dir_;
376 OpenApplicationWithReenablePrompt(params); 376 OpenApplicationWithReenablePrompt(params);
377 return true; 377 return true;
378 } 378 }
379 } else if (command_line_.HasSwitch(switches::kShowAppList)) { 379 } else if (command_line_.HasSwitch(switches::kShowAppList)) {
380 // This switch is used for shortcuts on the native desktop. 380 // This switch is used for shortcuts on the native desktop.
381 AppListService::RecordShowTimings(command_line_); 381 AppListService::RecordShowTimings(command_line_);
382 AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> 382 AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
383 ShowForProfile(profile); 383 ShowForProfile(profile);
384 return true; 384 return true;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // TODO(skerner): Could pass in |extension| and |launch_container|, 516 // TODO(skerner): Could pass in |extension| and |launch_container|,
517 // and avoid calling GetAppLaunchContainer() both here and in 517 // and avoid calling GetAppLaunchContainer() both here and in
518 // OpenApplicationTab(). 518 // OpenApplicationTab().
519 519
520 if (launch_container == extensions::LAUNCH_CONTAINER_TAB) 520 if (launch_container == extensions::LAUNCH_CONTAINER_TAB)
521 return false; 521 return false;
522 522
523 RecordCmdLineAppHistogram(extension->GetType()); 523 RecordCmdLineAppHistogram(extension->GetType());
524 524
525 AppLaunchParams params(profile, extension, launch_container, NEW_WINDOW); 525 AppLaunchParams params(profile, extension, launch_container, NEW_WINDOW);
526 params.command_line = &command_line_; 526 params.command_line = command_line_;
527 params.current_directory = cur_dir_; 527 params.current_directory = cur_dir_;
528 WebContents* tab_in_app_window = OpenApplication(params); 528 WebContents* tab_in_app_window = OpenApplication(params);
529 529
530 if (out_app_contents) 530 if (out_app_contents)
531 *out_app_contents = tab_in_app_window; 531 *out_app_contents = tab_in_app_window;
532 532
533 // Platform apps fire off a launch event which may or may not open a window. 533 // Platform apps fire off a launch event which may or may not open a window.
534 return (tab_in_app_window != NULL || extension->is_platform_app()); 534 return (tab_in_app_window != NULL || extension->is_platform_app());
535 } 535 }
536 536
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 } 991 }
992 992
993 #if !defined(OS_WIN) 993 #if !defined(OS_WIN)
994 // static 994 // static
995 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( 995 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
996 Profile* profile, 996 Profile* profile,
997 const std::vector<GURL>& startup_urls) { 997 const std::vector<GURL>& startup_urls) {
998 return false; 998 return false;
999 } 999 }
1000 #endif 1000 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698