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

Unified Diff: ash/common/system/chromeos/palette/common_palette_tool.h

Issue 2147783002: Add common palette tray implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus-tool-structure
Patch Set: Nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/system/chromeos/palette/common_palette_tool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/palette/common_palette_tool.h
diff --git a/ash/common/system/chromeos/palette/common_palette_tool.h b/ash/common/system/chromeos/palette/common_palette_tool.h
new file mode 100644
index 0000000000000000000000000000000000000000..67ef66fc23c22482f24e64bf1702f2db047dcab5
--- /dev/null
+++ b/ash/common/system/chromeos/palette/common_palette_tool.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
+#define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
+
+#include "ash/common/system/chromeos/palette/palette_tool.h"
+#include "ash/common/system/tray/hover_highlight_view.h"
+#include "ash/common/system/tray/view_click_listener.h"
+#include "base/strings/string16.h"
+#include "ui/gfx/vector_icons_public.h"
+
+namespace ash {
+
+// A PaletteTool implementation with a standard view support.
+class CommonPaletteTool : public PaletteTool, public ash::ViewClickListener {
+ protected:
+ explicit CommonPaletteTool(Delegate* delegate);
+ ~CommonPaletteTool() override;
+
+ // PaletteTool:
+ views::View* CreateView() override;
+ void OnViewDestroyed() override;
+ void OnEnable() override;
+ void OnDisable() override;
+
+ // ViewClickListener:
+ void OnViewClicked(views::View* sender) override;
+
+ // Returns the icon used in the palette tray on the left-most edge of the
+ // tool.
+ virtual gfx::VectorIconId GetPaletteIconId() = 0;
+
+ // Creates a default view implementation to be returned by CreateView.
+ views::View* CreateDefaultView(const base::string16& name);
+
+ private:
+ HoverHighlightView* highlight_view_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(CommonPaletteTool);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/system/chromeos/palette/common_palette_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698