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

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

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system_tray_client.h" 5 #include "chrome/browser/ui/ash/system_tray_client.h"
6 6
7 #include "ash/common/login_status.h" 7 #include "ash/common/login_status.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 NOTREACHED(); 81 NOTREACHED();
82 return ash::mojom::UpdateSeverity::CRITICAL; 82 return ash::mojom::UpdateSeverity::CRITICAL;
83 } 83 }
84 84
85 } // namespace 85 } // namespace
86 86
87 SystemTrayClient::SystemTrayClient() : binding_(this) { 87 SystemTrayClient::SystemTrayClient() : binding_(this) {
88 content::ServiceManagerConnection::GetForProcess() 88 content::ServiceManagerConnection::GetForProcess()
89 ->GetConnector() 89 ->GetConnector()
90 ->ConnectToInterface(ash_util::GetAshServiceName(), &system_tray_); 90 ->BindInterface(ash_util::GetAshServiceName(), &system_tray_);
91 // Register this object as the client interface implementation. 91 // Register this object as the client interface implementation.
92 system_tray_->SetClient(binding_.CreateInterfacePtrAndBind()); 92 system_tray_->SetClient(binding_.CreateInterfacePtrAndBind());
93 93
94 // If this observes clock setting changes before ash comes up the IPCs will 94 // If this observes clock setting changes before ash comes up the IPCs will
95 // be queued on |system_tray_|. 95 // be queued on |system_tray_|.
96 g_browser_process->platform_part()->GetSystemClock()->AddObserver(this); 96 g_browser_process->platform_part()->GetSystemClock()->AddObserver(this);
97 97
98 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 98 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
99 content::NotificationService::AllSources()); 99 content::NotificationService::AllSources());
100 100
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 chromeos::system::SystemClock* clock) { 374 chromeos::system::SystemClock* clock) {
375 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); 375 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock());
376 } 376 }
377 377
378 void SystemTrayClient::Observe(int type, 378 void SystemTrayClient::Observe(int type,
379 const content::NotificationSource& source, 379 const content::NotificationSource& source,
380 const content::NotificationDetails& details) { 380 const content::NotificationDetails& details) {
381 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); 381 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type);
382 HandleUpdateAvailable(); 382 HandleUpdateAvailable();
383 } 383 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/session_controller_client.cc ('k') | chrome/browser/ui/ash/volume_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698