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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tool.cc

Issue 2140343002: Add palette tool/manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus-add-icons
Patch Set: Address comments Created 4 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/common/system/chromeos/palette/palette_tool.h"
6
7 #include "ash/common/shelf/shelf_constants.h"
8 #include "ash/common/system/chromeos/palette/palette_ids.h"
9 #include "ash/common/system/chromeos/palette/palette_tool_manager.h"
10 #include "ash/common/system/tray/hover_highlight_view.h"
11 #include "ash/common/system/tray/view_click_listener.h"
12 #include "base/strings/utf_string_conversions.h"
13 #include "grit/ash_resources.h"
14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/paint_vector_icon.h"
16 #include "ui/gfx/vector_icons_public.h"
oshima 2016/07/14 13:58:32 Looks like not all headers are necessary?
jdufault 2016/07/18 20:39:57 Done, these are used in a dependent CL so I've mov
17
18 namespace ash {
19
20 // static
21 void PaletteTool::RegisterToolInstances(PaletteToolManager* tool_manager) {}
oshima 2016/07/14 13:58:32 what is this for? or add TODO?
jdufault 2016/07/18 20:39:57 Added a comment.
22
23 PaletteTool::PaletteTool() {}
24
25 PaletteTool::~PaletteTool() {}
26
27 void PaletteTool::Initialize(WmWindow* window,
28 const ToolAction& enable_tool,
29 const ToolAction& disable_tool) {
30 window_ = window;
31 enable_tool_ = enable_tool;
32 disable_tool_ = disable_tool;
oshima 2016/07/14 13:58:32 in initializer list?
jdufault 2016/07/18 20:39:57 Not a constructor :(
33 }
34
35 void PaletteTool::OnEnable() {
36 enabled_ = true;
37 }
38
39 void PaletteTool::OnDisable() {
40 enabled_ = false;
41 }
42
43 bool PaletteTool::enabled() const {
44 return enabled_;
oshima 2016/07/14 13:58:32 you may inline this.
jdufault 2016/07/18 20:39:57 Done.
45 }
46
47 void PaletteTool::EnableSelf() {
48 DCHECK(!enable_tool_.is_null()) << "PaletteTool was not initialized";
49
50 enable_tool_.Run(tool_id());
51 }
52
53 void PaletteTool::DisableSelf() {
54 DCHECK(!disable_tool_.is_null()) << "PaletteTool was not initialized";
55
56 disable_tool_.Run(tool_id());
57 }
58
59 WmWindow* PaletteTool::window() const {
60 return window_;
61 }
oshima 2016/07/14 13:58:32 this too
jdufault 2016/07/18 20:39:57 Done.
62
63 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698