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

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

Issue 2331093002: UMA stats for stylus usage (Closed)
Patch Set: Created 4 years, 3 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_app_utils.h" 5 #include "chrome/browser/chromeos/note_taking_app_utils.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/launcher.h" 10 #include "apps/launcher.h"
11 #include "ash/common/system/chromeos/palette/palette_utils.h" 11 #include "ash/common/system/chromeos/palette/palette_utils.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chromeos/chromeos_switches.h" 17 #include "chromeos/chromeos_switches.h"
18 #include "extensions/browser/app_window/app_window.h"
18 #include "extensions/browser/extension_registry.h" 19 #include "extensions/browser/extension_registry.h"
19 #include "extensions/common/api/app_runtime.h" 20 #include "extensions/common/api/app_runtime.h"
20 #include "extensions/common/extension.h" 21 #include "extensions/common/extension.h"
21 #include "url/gurl.h" 22 #include "url/gurl.h"
22 23
23 namespace app_runtime = extensions::api::app_runtime; 24 namespace app_runtime = extensions::api::app_runtime;
24 25
25 namespace chromeos { 26 namespace chromeos {
26 namespace { 27 namespace {
27 28
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (!app) { 80 if (!app) {
80 LOG(ERROR) << "Failed to find note-taking app"; 81 LOG(ERROR) << "Failed to find note-taking app";
81 return; 82 return;
82 } 83 }
83 84
84 auto action_data = base::MakeUnique<app_runtime::ActionData>(); 85 auto action_data = base::MakeUnique<app_runtime::ActionData>();
85 action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; 86 action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE;
86 apps::LaunchPlatformAppWithAction(profile, app, std::move(action_data), path); 87 apps::LaunchPlatformAppWithAction(profile, app, std::move(action_data), path);
87 } 88 }
88 89
90 bool IsCurrentAppNoteTakingApp(extensions::AppWindow* app_window) {
91 for (const char* id : kExtensionIds) {
xiyuan 2016/09/12 20:15:47 Line 46-54 above seems suggesting that the app ids
xiaoyinh(OOO Sep 11-29) 2016/09/16 18:41:15 Oh, I missed this case. Thanks for pointing that o
92 if (id == app_window->extension_id())
93 return true;
94 }
95 return false;
96 }
97
89 } // namespace chromeos 98 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698