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

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

Issue 2827193004: Make PrefService available in *ash (Closed)
Patch Set: Adding NOTREACHED() comment. Created 3 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | no next file » | 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) 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/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 ui::PAGE_TRANSITION_AUTO_BOOKMARK); 551 ui::PAGE_TRANSITION_AUTO_BOOKMARK);
552 params.disposition = WindowOpenDisposition::SINGLETON_TAB; 552 params.disposition = WindowOpenDisposition::SINGLETON_TAB;
553 chrome::Navigate(&params); 553 chrome::Navigate(&params);
554 } 554 }
555 555
556 gfx::Image ChromeShellDelegate::GetDeprecatedAcceleratorImage() const { 556 gfx::Image ChromeShellDelegate::GetDeprecatedAcceleratorImage() const {
557 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( 557 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(
558 IDR_BLUETOOTH_KEYBOARD); 558 IDR_BLUETOOTH_KEYBOARD);
559 } 559 }
560 560
561 PrefService* ChromeShellDelegate::GetActiveUserPrefService() const {
562 const user_manager::User* const user =
563 user_manager::UserManager::Get()->GetActiveUser();
564 return user ? chromeos::ProfileHelper::Get()
565 ->GetProfileByUser(user)
566 ->GetPrefs()
567 : nullptr;
568 }
569
561 bool ChromeShellDelegate::IsTouchscreenEnabledInPrefs( 570 bool ChromeShellDelegate::IsTouchscreenEnabledInPrefs(
562 bool use_local_state) const { 571 bool use_local_state) const {
563 return chromeos::system::InputDeviceSettings::Get() 572 return chromeos::system::InputDeviceSettings::Get()
564 ->IsTouchscreenEnabledInPrefs(use_local_state); 573 ->IsTouchscreenEnabledInPrefs(use_local_state);
565 } 574 }
566 575
567 void ChromeShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled, 576 void ChromeShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled,
568 bool use_local_state) { 577 bool use_local_state) {
569 chromeos::system::InputDeviceSettings::Get()->SetTouchscreenEnabledInPrefs( 578 chromeos::system::InputDeviceSettings::Get()->SetTouchscreenEnabledInPrefs(
570 enabled, use_local_state); 579 enabled, use_local_state);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 NOTREACHED() << "Unexpected notification " << type; 643 NOTREACHED() << "Unexpected notification " << type;
635 } 644 }
636 } 645 }
637 646
638 void ChromeShellDelegate::PlatformInit() { 647 void ChromeShellDelegate::PlatformInit() {
639 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 648 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
640 content::NotificationService::AllSources()); 649 content::NotificationService::AllSources());
641 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, 650 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED,
642 content::NotificationService::AllSources()); 651 content::NotificationService::AllSources());
643 } 652 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698