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

Side by Side Diff: chrome/browser/ui/ash/volume_controller.cc

Issue 2718043002: Replace more hardcoded "ash" strings with ash::mojom::kServiceName (Closed)
Patch Set: Remove ash_util includes that are no longer needed. Created 3 years, 9 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
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/ash/volume_controller.h" 5 #include "chrome/browser/ui/ash/volume_controller.h"
6 6
7 #include "ash/public/interfaces/accelerator_controller.mojom.h" 7 #include "ash/public/interfaces/accelerator_controller.mojom.h"
8 #include "ash/public/interfaces/constants.mojom.h"
8 #include "base/command_line.h" 9 #include "base/command_line.h"
9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
10 #include "chrome/browser/ui/ash/ash_util.h"
11 #include "chrome/grit/browser_resources.h" 11 #include "chrome/grit/browser_resources.h"
12 #include "chromeos/audio/chromeos_sounds.h" 12 #include "chromeos/audio/chromeos_sounds.h"
13 #include "chromeos/audio/cras_audio_handler.h" 13 #include "chromeos/audio/cras_audio_handler.h"
14 #include "chromeos/chromeos_switches.h" 14 #include "chromeos/chromeos_switches.h"
15 #include "content/public/common/service_manager_connection.h" 15 #include "content/public/common/service_manager_connection.h"
16 #include "media/audio/sounds/sounds_manager.h" 16 #include "media/audio/sounds/sounds_manager.h"
17 #include "services/service_manager/public/cpp/connector.h" 17 #include "services/service_manager/public/cpp/connector.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 19
20 namespace { 20 namespace {
(...skipping 14 matching lines...) Expand all
35 } 35 }
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 VolumeController::VolumeController() : binding_(this) { 40 VolumeController::VolumeController() : binding_(this) {
41 // Connect to the accelerator controller interface in the ash service. 41 // Connect to the accelerator controller interface in the ash service.
42 service_manager::Connector* connector = 42 service_manager::Connector* connector =
43 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 43 content::ServiceManagerConnection::GetForProcess()->GetConnector();
44 ash::mojom::AcceleratorControllerPtr accelerator_controller_ptr; 44 ash::mojom::AcceleratorControllerPtr accelerator_controller_ptr;
45 connector->BindInterface(ash_util::GetAshServiceName(), 45 connector->BindInterface(ash::mojom::kServiceName,
46 &accelerator_controller_ptr); 46 &accelerator_controller_ptr);
47 47
48 // Register this object as the volume controller. 48 // Register this object as the volume controller.
49 accelerator_controller_ptr->SetVolumeController( 49 accelerator_controller_ptr->SetVolumeController(
50 binding_.CreateInterfacePtrAndBind()); 50 binding_.CreateInterfacePtrAndBind());
51 51
52 if (VolumeAdjustSoundEnabled()) { 52 if (VolumeAdjustSoundEnabled()) {
53 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 53 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
54 media::SoundsManager::Get()->Initialize( 54 media::SoundsManager::Get()->Initialize(
55 chromeos::SOUND_VOLUME_ADJUST, 55 chromeos::SOUND_VOLUME_ADJUST,
(...skipping 28 matching lines...) Expand all
84 audio_handler->AdjustOutputVolumeToAudibleLevel(); 84 audio_handler->AdjustOutputVolumeToAudibleLevel();
85 play_sound = true; 85 play_sound = true;
86 } else { 86 } else {
87 play_sound = audio_handler->GetOutputVolumePercent() != 100; 87 play_sound = audio_handler->GetOutputVolumePercent() != 100;
88 audio_handler->AdjustOutputVolumeByPercent(kStepPercentage); 88 audio_handler->AdjustOutputVolumeByPercent(kStepPercentage);
89 } 89 }
90 90
91 if (play_sound) 91 if (play_sound)
92 PlayVolumeAdjustSound(); 92 PlayVolumeAdjustSound();
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_client.cc ('k') | chrome/browser/ui/ash/vpn_list_forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698