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

Side by Side Diff: ash/common/system/chromeos/palette/common_palette_tool.h

Issue 2308823002: Add UMA stats for pen palette (Closed)
Patch Set: rebase 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 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
7 7
8 #include "ash/common/system/chromeos/palette/palette_tool.h" 8 #include "ash/common/system/chromeos/palette/palette_tool.h"
9 #include "ash/common/system/tray/hover_highlight_view.h" 9 #include "ash/common/system/tray/hover_highlight_view.h"
10 #include "ash/common/system/tray/view_click_listener.h" 10 #include "ash/common/system/tray/view_click_listener.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/time/time.h"
12 #include "ui/gfx/vector_icons_public.h" 13 #include "ui/gfx/vector_icons_public.h"
13 14
14 namespace ash { 15 namespace ash {
15 16
16 // A PaletteTool implementation with a standard view support. 17 // A PaletteTool implementation with a standard view support.
17 class CommonPaletteTool : public PaletteTool, public ash::ViewClickListener { 18 class CommonPaletteTool : public PaletteTool, public ash::ViewClickListener {
18 protected: 19 protected:
19 explicit CommonPaletteTool(Delegate* delegate); 20 explicit CommonPaletteTool(Delegate* delegate);
20 ~CommonPaletteTool() override; 21 ~CommonPaletteTool() override;
21 22
22 // PaletteTool: 23 // PaletteTool:
23 views::View* CreateView() override; 24 views::View* CreateView() override;
24 void OnViewDestroyed() override; 25 void OnViewDestroyed() override;
25 void OnEnable() override; 26 void OnEnable() override;
26 void OnDisable() override; 27 void OnDisable() override;
27 28
28 // ViewClickListener: 29 // ViewClickListener:
29 void OnViewClicked(views::View* sender) override; 30 void OnViewClicked(views::View* sender) override;
30 31
31 // Returns the icon used in the palette tray on the left-most edge of the 32 // Returns the icon used in the palette tray on the left-most edge of the
32 // tool. 33 // tool.
33 virtual gfx::VectorIconId GetPaletteIconId() = 0; 34 virtual gfx::VectorIconId GetPaletteIconId() = 0;
34 35
35 // Creates a default view implementation to be returned by CreateView. 36 // Creates a default view implementation to be returned by CreateView.
36 views::View* CreateDefaultView(const base::string16& name); 37 views::View* CreateDefaultView(const base::string16& name);
37 38
38 private: 39 private:
39 HoverHighlightView* highlight_view_ = nullptr; 40 HoverHighlightView* highlight_view_ = nullptr;
41 base::TimeTicks start_time_;
jdufault 2016/09/02 21:54:30 Add a comment, maybe something like // When the t
jdufault 2016/09/02 21:54:30 Can we use base::Time?
Ilya Sherman 2016/09/02 22:02:49 base::Time is susceptible to timezone changes, etc
xiaoyinh(OOO Sep 11-29) 2016/09/06 17:40:05 Done.
40 42
41 DISALLOW_COPY_AND_ASSIGN(CommonPaletteTool); 43 DISALLOW_COPY_AND_ASSIGN(CommonPaletteTool);
42 }; 44 };
43 45
44 } // namespace ash 46 } // namespace ash
45 47
46 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ 48 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698