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

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: clang fix. 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // KioskAppLauncher deletes itself when done. 266 // KioskAppLauncher deletes itself when done.
267 (new KioskAppLauncher( 267 (new KioskAppLauncher(
268 KioskAppManager::Get()->GetAutoLaunchApp()))->Start(); 268 KioskAppManager::Get()->GetAutoLaunchApp()))->Start();
269 269
270 // Login screen is skipped but 'login-prompt-visible' signal is still needed. 270 // Login screen is skipped but 'login-prompt-visible' signal is still needed.
271 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible"; 271 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible";
272 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 272 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
273 EmitLoginPromptVisible(); 273 EmitLoginPromptVisible();
274 } 274 }
275 275
276 bool UseNewAudioHandler() {
277 return !CommandLine::ForCurrentProcess()->
278 HasSwitch(ash::switches::kAshDisableNewAudioHandler);
279 }
280
276 } // namespace 281 } // namespace
277 282
278 namespace internal { 283 namespace internal {
279 284
280 // Wrapper class for initializing dbus related services and shutting them 285 // Wrapper class for initializing dbus related services and shutting them
281 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the 286 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the
282 // destructor will get called if and only if this has been instantiated. 287 // destructor will get called if and only if this has been instantiated.
283 class DBusServices { 288 class DBusServices {
284 public: 289 public:
285 explicit DBusServices(const content::MainFunctionParams& parameters) 290 explicit DBusServices(const content::MainFunctionParams& parameters)
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } 476 }
472 477
473 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. 478 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun.
474 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. 479 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads.
475 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { 480 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() {
476 // TODO(rkc): Once the CrasAudioHandler is initialized by default, move 481 // TODO(rkc): Once the CrasAudioHandler is initialized by default, move
477 // the code from CrasAudioSwitchHandler into it and remove this line. 482 // the code from CrasAudioSwitchHandler into it and remove this line.
478 if (CommandLine::ForCurrentProcess()->HasSwitch( 483 if (CommandLine::ForCurrentProcess()->HasSwitch(
479 chromeos::switches::kEnableChromeAudioSwitching)) 484 chromeos::switches::kEnableChromeAudioSwitching))
480 CrasAudioSwitchHandler::Initialize(); 485 CrasAudioSwitchHandler::Initialize();
481 486 if (UseNewAudioHandler()) {
482 if (CommandLine::ForCurrentProcess()-> 487 CrasAudioHandler::Initialize(
483 HasSwitch(ash::switches::kAshEnableNewAudioHandler)) { 488 AudioPrefHandler::Create(g_browser_process->local_state()));
484 CrasAudioHandler::Initialize(
485 AudioPrefHandler::Create(g_browser_process->local_state()));
486 } else { 489 } else {
487 AudioHandler::Initialize( 490 AudioHandler::Initialize(
488 AudioPrefHandler::Create(g_browser_process->local_state())); 491 AudioPrefHandler::Create(g_browser_process->local_state()));
489 } 492 }
490 493
491 if (!StartupUtils::IsOobeCompleted()) 494 if (!StartupUtils::IsOobeCompleted())
492 system::StatisticsProvider::GetInstance()->LoadOemManifest(); 495 system::StatisticsProvider::GetInstance()->LoadOemManifest();
493 496
494 base::FilePath downloads_directory; 497 base::FilePath downloads_directory;
495 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory)); 498 CHECK(PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_directory));
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 peripheral_battery_observer_.reset(); 790 peripheral_battery_observer_.reset();
788 791
789 // The XInput2 event listener needs to be shut down earlier than when 792 // The XInput2 event listener needs to be shut down earlier than when
790 // Singletons are finally destroyed in AtExitManager. 793 // Singletons are finally destroyed in AtExitManager.
791 XInputHierarchyChangedEventListener::GetInstance()->Stop(); 794 XInputHierarchyChangedEventListener::GetInstance()->Stop();
792 795
793 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, 796 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
794 // even if Initialize() wasn't called. 797 // even if Initialize() wasn't called.
795 SystemKeyEventListener::Shutdown(); 798 SystemKeyEventListener::Shutdown();
796 imageburner::BurnManager::Shutdown(); 799 imageburner::BurnManager::Shutdown();
797 if (CommandLine::ForCurrentProcess()-> 800 if (UseNewAudioHandler()) {
798 HasSwitch(ash::switches::kAshEnableNewAudioHandler)) {
799 CrasAudioHandler::Shutdown(); 801 CrasAudioHandler::Shutdown();
800 } else { 802 } else {
801 AudioHandler::Shutdown(); 803 AudioHandler::Shutdown();
802 } 804 }
803 805
804 if (CommandLine::ForCurrentProcess()->HasSwitch( 806 if (CommandLine::ForCurrentProcess()->HasSwitch(
805 chromeos::switches::kEnableChromeAudioSwitching)) 807 chromeos::switches::kEnableChromeAudioSwitching))
806 CrasAudioSwitchHandler::Shutdown(); 808 CrasAudioSwitchHandler::Shutdown();
807 809
808 WebSocketProxyController::Shutdown(); 810 WebSocketProxyController::Shutdown();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 891 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
890 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 892 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
891 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 893 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
892 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 894 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
893 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 895 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
894 // This is necessary to start the experiment as a side effect. 896 // This is necessary to start the experiment as a side effect.
895 trial->group(); 897 trial->group();
896 } 898 }
897 899
898 } // namespace chromeos 900 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698