| OLD | NEW |
| (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 "base/logging.h" |
| 8 |
| 9 namespace ash { |
| 10 |
| 11 // static |
| 12 void PaletteTool::RegisterToolInstances(PaletteToolManager* tool_manager) {} |
| 13 |
| 14 PaletteTool::PaletteTool() {} |
| 15 |
| 16 PaletteTool::~PaletteTool() {} |
| 17 |
| 18 void PaletteTool::Initialize(WmWindow* window, |
| 19 const ToolAction& enable_tool, |
| 20 const ToolAction& disable_tool) { |
| 21 window_ = window; |
| 22 enable_tool_ = enable_tool; |
| 23 disable_tool_ = disable_tool; |
| 24 } |
| 25 |
| 26 void PaletteTool::OnEnable() { |
| 27 enabled_ = true; |
| 28 } |
| 29 |
| 30 void PaletteTool::OnDisable() { |
| 31 enabled_ = false; |
| 32 } |
| 33 |
| 34 void PaletteTool::EnableSelf() { |
| 35 DCHECK(!enable_tool_.is_null()) << "PaletteTool was not initialized"; |
| 36 |
| 37 enable_tool_.Run(tool_id()); |
| 38 } |
| 39 |
| 40 void PaletteTool::DisableSelf() { |
| 41 DCHECK(!disable_tool_.is_null()) << "PaletteTool was not initialized"; |
| 42 |
| 43 disable_tool_.Run(tool_id()); |
| 44 } |
| 45 |
| 46 } // namespace ash |
| OLD | NEW |