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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/options_stylus_handler.cc

Issue 2644713002: cros: Use runtime stylus detection for ash palette. (Closed)
Patch Set: Initial upload 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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/webui/options/chromeos/options_stylus_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/options_stylus_handler.h"
6 6
7 #include "ash/common/system/chromeos/palette/palette_utils.h" 7 #include "ash/common/system/chromeos/palette/palette_utils.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 l10n_util::GetStringUTF16(IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_LABEL)); 54 l10n_util::GetStringUTF16(IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_LABEL));
55 localized_strings->SetString( 55 localized_strings->SetString(
56 "stylusNoteTakingAppNoneAvailable", 56 "stylusNoteTakingAppNoneAvailable",
57 l10n_util::GetStringUTF16( 57 l10n_util::GetStringUTF16(
58 IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_NONE_AVAILABLE)); 58 IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_NONE_AVAILABLE));
59 localized_strings->SetString( 59 localized_strings->SetString(
60 "stylusNoteTakingAppWaitingForAndroid", 60 "stylusNoteTakingAppWaitingForAndroid",
61 l10n_util::GetStringUTF16( 61 l10n_util::GetStringUTF16(
62 IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID)); 62 IDS_OPTIONS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID));
63 63
64 localized_strings->SetBoolean("showStylusSettings", 64 localized_strings->SetBoolean("showStylusSettings", ash::HasStylusInput());
stevenjb 2017/01/21 00:23:50 Do we need an observer now to set this if it chang
jdufault 2017/01/25 00:53:15 Technically, yes, but I think the only time this w
stevenjb 2017/01/25 01:12:13 Custom flags are not too uncommon, so this really
jdufault 2017/02/03 20:30:19 If Chrome browser process crashed and immediately
65 ash::IsPaletteFeatureEnabled());
66 } 65 }
67 66
68 void OptionsStylusHandler::InitializePage() { 67 void OptionsStylusHandler::InitializePage() {
69 UpdateNoteTakingApps(); 68 UpdateNoteTakingApps();
70 } 69 }
71 70
72 void OptionsStylusHandler::RegisterMessages() { 71 void OptionsStylusHandler::RegisterMessages() {
73 web_ui()->RegisterMessageCallback( 72 web_ui()->RegisterMessageCallback(
74 "setPreferredNoteTakingApp", 73 "setPreferredNoteTakingApp",
75 base::Bind(&OptionsStylusHandler::SetPreferredNoteTakingApp, 74 base::Bind(&OptionsStylusHandler::SetPreferredNoteTakingApp,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 LOG(ERROR) << "Got unknown note-taking-app ID \"" << app_id << "\""; 120 LOG(ERROR) << "Got unknown note-taking-app ID \"" << app_id << "\"";
122 return; 121 return;
123 } 122 }
124 123
125 NoteTakingHelper::Get()->SetPreferredApp(Profile::FromWebUI(web_ui()), 124 NoteTakingHelper::Get()->SetPreferredApp(Profile::FromWebUI(web_ui()),
126 app_id); 125 app_id);
127 } 126 }
128 127
129 } // namespace options 128 } // namespace options
130 } // namespace chromeos 129 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698