| OLD | NEW |
| 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 "ash/system/palette/palette_tool.h" | 5 #include "ash/system/palette/palette_tool.h" |
| 6 #include "ash/system/palette/palette_tool_manager.h" | 6 #include "ash/system/palette/palette_tool_manager.h" |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 public: | 48 public: |
| 49 PaletteToolManagerTest() | 49 PaletteToolManagerTest() |
| 50 : palette_tool_manager_(new PaletteToolManager(this)) {} | 50 : palette_tool_manager_(new PaletteToolManager(this)) {} |
| 51 ~PaletteToolManagerTest() override {} | 51 ~PaletteToolManagerTest() override {} |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 // PaletteToolManager::Delegate: | 54 // PaletteToolManager::Delegate: |
| 55 void HidePalette() override {} | 55 void HidePalette() override {} |
| 56 void HidePaletteImmediately() override {} | 56 void HidePaletteImmediately() override {} |
| 57 void OnActiveToolChanged() override { ++tool_changed_count_; } | 57 void OnActiveToolChanged() override { ++tool_changed_count_; } |
| 58 WmWindow* GetWindow() override { | 58 aura::Window* GetWindow() override { |
| 59 NOTREACHED(); | 59 NOTREACHED(); |
| 60 return nullptr; | 60 return nullptr; |
| 61 } | 61 } |
| 62 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override {} | 62 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override {} |
| 63 void RecordPaletteModeCancellation(PaletteModeCancelType type) override {} | 63 void RecordPaletteModeCancellation(PaletteModeCancelType type) override {} |
| 64 | 64 |
| 65 // PaletteTool::Delegate: | 65 // PaletteTool::Delegate: |
| 66 void EnableTool(PaletteToolId tool_id) override {} | 66 void EnableTool(PaletteToolId tool_id) override {} |
| 67 void DisableTool(PaletteToolId tool_id) override {} | 67 void DisableTool(PaletteToolId tool_id) override {} |
| 68 | 68 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 // Activating an already active tool will not do anything. | 129 // Activating an already active tool will not do anything. |
| 130 palette_tool_manager_->ActivateTool(action_1->GetToolId()); | 130 palette_tool_manager_->ActivateTool(action_1->GetToolId()); |
| 131 EXPECT_TRUE(action_1->enabled()); | 131 EXPECT_TRUE(action_1->enabled()); |
| 132 EXPECT_FALSE(action_2->enabled()); | 132 EXPECT_FALSE(action_2->enabled()); |
| 133 palette_tool_manager_->ActivateTool(action_1->GetToolId()); | 133 palette_tool_manager_->ActivateTool(action_1->GetToolId()); |
| 134 EXPECT_TRUE(action_1->enabled()); | 134 EXPECT_TRUE(action_1->enabled()); |
| 135 EXPECT_FALSE(action_2->enabled()); | 135 EXPECT_FALSE(action_2->enabled()); |
| 136 palette_tool_manager_->DeactivateTool(action_1->GetToolId()); | 136 palette_tool_manager_->DeactivateTool(action_1->GetToolId()); |
| 137 } | 137 } |
| OLD | NEW |