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

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

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fix Created 7 years, 2 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/ui/ash/ash_init.cc ('k') | chrome/browser/ui/ash/event_rewriter.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) 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/caps_lock_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/caps_lock_delegate_chromeos.h"
6 6
7 #include "base/chromeos/chromeos_version.h"
8 #include "base/command_line.h" 7 #include "base/command_line.h"
9 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_info.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
11 #include "chromeos/ime/xkeyboard.h" 11 #include "chromeos/ime/xkeyboard.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 13
14 CapsLockDelegate::CapsLockDelegate(chromeos::input_method::XKeyboard* xkeyboard) 14 CapsLockDelegate::CapsLockDelegate(chromeos::input_method::XKeyboard* xkeyboard)
15 : xkeyboard_(xkeyboard), 15 : xkeyboard_(xkeyboard),
16 is_running_on_chromeos_(base::chromeos::IsRunningOnChromeOS()), 16 is_running_on_chromeos_(base::SysInfo::IsRunningOnChromeOS()),
17 caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) { 17 caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) {
18 chromeos::SystemKeyEventListener* system_event_listener = 18 chromeos::SystemKeyEventListener* system_event_listener =
19 chromeos::SystemKeyEventListener::GetInstance(); 19 chromeos::SystemKeyEventListener::GetInstance();
20 // SystemKeyEventListener should be instantiated when we're running production 20 // SystemKeyEventListener should be instantiated when we're running production
21 // code on Chrome OS. 21 // code on Chrome OS.
22 DCHECK(!is_running_on_chromeos_ || system_event_listener || 22 DCHECK(!is_running_on_chromeos_ || system_event_listener ||
23 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)); 23 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType));
24 if (system_event_listener) 24 if (system_event_listener)
25 system_event_listener->AddCapsLockObserver(this); 25 system_event_listener->AddCapsLockObserver(this);
26 } 26 }
(...skipping 21 matching lines...) Expand all
48 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 48 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
49 if (is_running_on_chromeos_) { 49 if (is_running_on_chromeos_) {
50 xkeyboard_->SetCapsLockEnabled(!caps_lock_is_on_); 50 xkeyboard_->SetCapsLockEnabled(!caps_lock_is_on_);
51 return; 51 return;
52 } 52 }
53 } 53 }
54 54
55 void CapsLockDelegate::OnCapsLockChange(bool enabled) { 55 void CapsLockDelegate::OnCapsLockChange(bool enabled) {
56 caps_lock_is_on_ = enabled; 56 caps_lock_is_on_ = enabled;
57 } 57 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_init.cc ('k') | chrome/browser/ui/ash/event_rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698