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

Side by Side Diff: chrome/browser/chromeos/note_taking_helper.cc

Issue 2644713002: cros: Use runtime stylus detection for ash palette. (Closed)
Patch Set: Fix test Created 3 years, 10 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/chromeos/note_taking_helper.h" 5 #include "chrome/browser/chromeos/note_taking_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "apps/launcher.h" 10 #include "apps/launcher.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void NoteTakingHelper::SetPreferredApp(Profile* profile, 144 void NoteTakingHelper::SetPreferredApp(Profile* profile,
145 const std::string& app_id) { 145 const std::string& app_id) {
146 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 146 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
147 DCHECK(profile); 147 DCHECK(profile);
148 profile->GetPrefs()->SetString(prefs::kNoteTakingAppId, app_id); 148 profile->GetPrefs()->SetString(prefs::kNoteTakingAppId, app_id);
149 } 149 }
150 150
151 bool NoteTakingHelper::IsAppAvailable(Profile* profile) { 151 bool NoteTakingHelper::IsAppAvailable(Profile* profile) {
152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 152 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
153 DCHECK(profile); 153 DCHECK(profile);
154 return ash::IsPaletteFeatureEnabled() && !GetAvailableApps(profile).empty(); 154 return ash::palette_utils::HasStylusInput() &&
155 !GetAvailableApps(profile).empty();
155 } 156 }
156 157
157 void NoteTakingHelper::LaunchAppForNewNote(Profile* profile, 158 void NoteTakingHelper::LaunchAppForNewNote(Profile* profile,
158 const base::FilePath& path) { 159 const base::FilePath& path) {
159 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 160 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
160 DCHECK(profile); 161 DCHECK(profile);
161 162
162 LaunchResult result = LaunchResult::NO_APP_SPECIFIED; 163 LaunchResult result = LaunchResult::NO_APP_SPECIFIED;
163 std::string app_id = profile->GetPrefs()->GetString(prefs::kNoteTakingAppId); 164 std::string app_id = profile->GetPrefs()->GetString(prefs::kNoteTakingAppId);
164 if (!app_id.empty()) 165 if (!app_id.empty())
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 for (auto& observer : observers_) 414 for (auto& observer : observers_)
414 observer.OnAvailableNoteTakingAppsUpdated(); 415 observer.OnAvailableNoteTakingAppsUpdated();
415 } 416 }
416 } 417 }
417 418
418 void NoteTakingHelper::OnShutdown(extensions::ExtensionRegistry* registry) { 419 void NoteTakingHelper::OnShutdown(extensions::ExtensionRegistry* registry) {
419 extension_registry_observer_.Remove(registry); 420 extension_registry_observer_.Remove(registry);
420 } 421 }
421 422
422 } // namespace chromeos 423 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/chrome_restart_request.cc ('k') | chrome/browser/chromeos/note_taking_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698