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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 14678004: cros: Enable new cras audio handler by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // KioskAppLauncher deletes itself when done. 265 // KioskAppLauncher deletes itself when done.
266 (new KioskAppLauncher( 266 (new KioskAppLauncher(
267 KioskAppManager::Get()->GetAutoLaunchApp()))->Start(); 267 KioskAppManager::Get()->GetAutoLaunchApp()))->Start();
268 268
269 // Login screen is skipped but 'login-prompt-visible' signal is still needed. 269 // Login screen is skipped but 'login-prompt-visible' signal is still needed.
270 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible"; 270 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible";
271 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 271 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
272 EmitLoginPromptVisible(); 272 EmitLoginPromptVisible();
273 } 273 }
274 274
275 bool UseNewAudioHandler() {
276 return !CommandLine::ForCurrentProcess()->
277 HasSwitch(ash::switches::kAshDisableNewAudioHandler);
278 }
279
275 } // namespace 280 } // namespace
276 281
277 namespace internal { 282 namespace internal {
278 283
279 // Wrapper class for initializing dbus related services and shutting them 284 // Wrapper class for initializing dbus related services and shutting them
280 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the 285 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the
281 // destructor will get called if and only if this has been instantiated. 286 // destructor will get called if and only if this has been instantiated.
282 class DBusServices { 287 class DBusServices {
283 public: 288 public:
284 explicit DBusServices(const content::MainFunctionParams& parameters) 289 explicit DBusServices(const content::MainFunctionParams& parameters)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 message_loop->AddObserver(g_message_loop_observer.Pointer()); 470 message_loop->AddObserver(g_message_loop_observer.Pointer());
466 471
467 dbus_services_.reset(new internal::DBusServices(parameters())); 472 dbus_services_.reset(new internal::DBusServices(parameters()));
468 473
469 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); 474 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart();
470 } 475 }
471 476
472 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. 477 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun.
473 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. 478 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads.
474 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { 479 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() {
475 if (CommandLine::ForCurrentProcess()-> 480 if (UseNewAudioHandler()) {
476 HasSwitch(ash::switches::kAshEnableNewAudioHandler)) {
477 CrasAudioHandler::Initialize( 481 CrasAudioHandler::Initialize(
478 AudioPrefHandler::Create(g_browser_process->local_state())); 482 AudioPrefHandler::Create(g_browser_process->local_state()));
479 } else { 483 } else {
480 AudioHandler::Initialize( 484 AudioHandler::Initialize(
481 AudioPrefHandler::Create(g_browser_process->local_state())); 485 AudioPrefHandler::Create(g_browser_process->local_state()));
482 } 486 }
483 487
484 if (!StartupUtils::IsOobeCompleted()) 488 if (!StartupUtils::IsOobeCompleted())
485 system::StatisticsProvider::GetInstance()->LoadOemManifest(); 489 system::StatisticsProvider::GetInstance()->LoadOemManifest();
486 490
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 peripheral_battery_observer_.reset(); 784 peripheral_battery_observer_.reset();
781 785
782 // The XInput2 event listener needs to be shut down earlier than when 786 // The XInput2 event listener needs to be shut down earlier than when
783 // Singletons are finally destroyed in AtExitManager. 787 // Singletons are finally destroyed in AtExitManager.
784 XInputHierarchyChangedEventListener::GetInstance()->Stop(); 788 XInputHierarchyChangedEventListener::GetInstance()->Stop();
785 789
786 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, 790 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
787 // even if Initialize() wasn't called. 791 // even if Initialize() wasn't called.
788 SystemKeyEventListener::Shutdown(); 792 SystemKeyEventListener::Shutdown();
789 imageburner::BurnManager::Shutdown(); 793 imageburner::BurnManager::Shutdown();
790 if (CommandLine::ForCurrentProcess()-> 794 if (UseNewAudioHandler()) {
791 HasSwitch(ash::switches::kAshEnableNewAudioHandler)) {
792 CrasAudioHandler::Shutdown(); 795 CrasAudioHandler::Shutdown();
793 } else { 796 } else {
794 AudioHandler::Shutdown(); 797 AudioHandler::Shutdown();
795 } 798 }
796 799
797 WebSocketProxyController::Shutdown(); 800 WebSocketProxyController::Shutdown();
798 801
799 // Let classes unregister themselves as observers of the ash::Shell singleton 802 // Let classes unregister themselves as observers of the ash::Shell singleton
800 // before the shell is destroyed. 803 // before the shell is destroyed.
801 user_activity_notifier_.reset(); 804 user_activity_notifier_.reset();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 881 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
879 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 882 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
880 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 883 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
881 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 884 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
882 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 885 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
883 // This is necessary to start the experiment as a side effect. 886 // This is necessary to start the experiment as a side effect.
884 trial->group(); 887 trial->group();
885 } 888 }
886 889
887 } // namespace chromeos 890 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698