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

Unified Diff: ui/views/color_chooser/color_chooser_view.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 | « ui/views/color_chooser/color_chooser_listener.h ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/color_chooser/color_chooser_view.h
diff --git a/ui/views/color_chooser/color_chooser_view.h b/ui/views/color_chooser/color_chooser_view.h
deleted file mode 100644
index 532e8232ff1c80db4c84599b325f7e2e06a29c7a..0000000000000000000000000000000000000000
--- a/ui/views/color_chooser/color_chooser_view.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
-#define UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "third_party/skia/include/core/SkColor.h"
-#include "third_party/skia/include/core/SkScalar.h"
-#include "ui/views/controls/textfield/textfield_controller.h"
-#include "ui/views/views_export.h"
-#include "ui/views/widget/widget_delegate.h"
-
-namespace views {
-
-class ColorChooserListener;
-class Textfield;
-
-// ColorChooserView provides the UI to choose a color by mouse and/or keyboard.
-// It is typically used for <input type="color">. Currently the user can
-// choose a color by dragging over the bar for hue and the area for saturation
-// and value.
-class VIEWS_EXPORT ColorChooserView : public WidgetDelegateView,
- public TextfieldController {
- public:
- ColorChooserView(ColorChooserListener* listener, SkColor initial_color);
- virtual ~ColorChooserView();
-
- // Called when its color value is changed in the web contents.
- void OnColorChanged(SkColor color);
-
- // Called when the user chooses a hue from the UI.
- void OnHueChosen(SkScalar hue);
-
- // Called when the user chooses saturation/value from the UI.
- void OnSaturationValueChosen(SkScalar saturation, SkScalar value);
-
- float hue() const { return hsv_[0]; }
- float saturation() const { return hsv_[1]; }
- float value() const { return hsv_[2]; }
- void set_listener(ColorChooserListener* listener) { listener_ = listener; }
-
- private:
- class HueView;
- class SaturationValueView;
- class SelectedColorPatchView;
-
- // WidgetDelegate overrides:
- virtual bool CanMinimize() const override;
- virtual View* GetInitiallyFocusedView() override;
- virtual ui::ModalType GetModalType() const override;
- virtual void WindowClosing() override;
- virtual View* GetContentsView() override;
-
- // TextfieldController overrides:
- virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) override;
- virtual bool HandleKeyEvent(Textfield* sender,
- const ui::KeyEvent& key_event) override;
-
- // The current color in HSV coordinate.
- SkScalar hsv_[3];
-
- // The pointer to the current color chooser for callbacks. It doesn't take
- // ownership on |listener_| so the user of this class should take care of
- // its lifetime. See chrome/browser/ui/browser.cc for example.
- ColorChooserListener* listener_;
-
- // Child views. These are owned as part of the normal views hierarchy.
- // The view of hue chooser.
- HueView* hue_;
-
- // The view of saturation/value choosing area.
- SaturationValueView* saturation_value_;
-
- // The textfield to write the color explicitly.
- Textfield* textfield_;
-
- // The rectangle to denote the selected color.
- SelectedColorPatchView* selected_color_patch_;
-
- DISALLOW_COPY_AND_ASSIGN(ColorChooserView);
-};
-
-} // namespace views
-
-#endif // UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
« no previous file with comments | « ui/views/color_chooser/color_chooser_listener.h ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698