| 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 "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" |
| 17 |
| 18 namespace ash { |
| 19 |
| 20 // static |
| 21 void PaletteTool::RegisterToolInstances(PaletteToolManager* tool_manager) {} |
| 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; |
| 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_; |
| 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 } |
| 62 |
| 63 } // namespace ash |
| OLD | NEW |