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

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

Issue 14455012: 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 peripheral_battery_observer_.reset(); 793 peripheral_battery_observer_.reset();
790 794
791 // The XInput2 event listener needs to be shut down earlier than when 795 // The XInput2 event listener needs to be shut down earlier than when
792 // Singletons are finally destroyed in AtExitManager. 796 // Singletons are finally destroyed in AtExitManager.
793 XInputHierarchyChangedEventListener::GetInstance()->Stop(); 797 XInputHierarchyChangedEventListener::GetInstance()->Stop();
794 798
795 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, 799 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
796 // even if Initialize() wasn't called. 800 // even if Initialize() wasn't called.
797 SystemKeyEventListener::Shutdown(); 801 SystemKeyEventListener::Shutdown();
798 imageburner::BurnManager::Shutdown(); 802 imageburner::BurnManager::Shutdown();
799 if (CommandLine::ForCurrentProcess()-> 803 if (UseNewAudioHandler()) {
800 HasSwitch(ash::switches::kAshEnableNewAudioHandler)) {
801 CrasAudioHandler::Shutdown(); 804 CrasAudioHandler::Shutdown();
802 } else { 805 } else {
803 AudioHandler::Shutdown(); 806 AudioHandler::Shutdown();
804 } 807 }
805 808
806 WebSocketProxyController::Shutdown(); 809 WebSocketProxyController::Shutdown();
807 810
808 // Let classes unregister themselves as observers of the ash::Shell singleton 811 // Let classes unregister themselves as observers of the ash::Shell singleton
809 // before the shell is destroyed. 812 // before the shell is destroyed.
810 user_activity_notifier_.reset(); 813 user_activity_notifier_.reset();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 890 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
888 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 891 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
889 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 892 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
890 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 893 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
891 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 894 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
892 // This is necessary to start the experiment as a side effect. 895 // This is necessary to start the experiment as a side effect.
893 trial->group(); 896 trial->group();
894 } 897 }
895 898
896 } // namespace chromeos 899 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698