| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/ui/views/color_chooser_dialog.h" | 9 #include "chrome/browser/ui/views/color_chooser_dialog.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/shell_dialogs/base_shell_dialog.h" | 11 #include "ui/shell_dialogs/base_shell_dialog.h" |
| 12 #include "ui/shell_dialogs/base_shell_dialog_win.h" | 12 #include "ui/shell_dialogs/base_shell_dialog_win.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class ColorChooserListener; | 15 class ColorChooserListener; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class ColorChooserDialog | 18 class ColorChooserDialog |
| 19 : public base::RefCountedThreadSafe<ColorChooserDialog>, | 19 : public base::RefCountedThreadSafe<ColorChooserDialog>, |
| 20 public ui::BaseShellDialog, | 20 public ui::BaseShellDialog, |
| 21 public ui::BaseShellDialogImpl { | 21 public ui::BaseShellDialogImpl { |
| 22 public: | 22 public: |
| 23 ColorChooserDialog(views::ColorChooserListener* listener, | 23 ColorChooserDialog(views::ColorChooserListener* listener, |
| 24 SkColor initial_color, | 24 SkColor initial_color, |
| 25 gfx::NativeWindow owning_window); | 25 gfx::NativeWindow owning_window); |
| 26 virtual ~ColorChooserDialog(); | 26 virtual ~ColorChooserDialog(); |
| 27 | 27 |
| 28 // BaseShellDialog: | 28 // BaseShellDialog: |
| 29 virtual bool IsRunning(gfx::NativeWindow owning_window) const OVERRIDE; | 29 virtual bool IsRunning(gfx::NativeWindow owning_window) const override; |
| 30 virtual void ListenerDestroyed() OVERRIDE; | 30 virtual void ListenerDestroyed() override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 struct ExecuteOpenParams { | 33 struct ExecuteOpenParams { |
| 34 ExecuteOpenParams(SkColor color, RunState run_state, HWND owner); | 34 ExecuteOpenParams(SkColor color, RunState run_state, HWND owner); |
| 35 SkColor color; | 35 SkColor color; |
| 36 RunState run_state; | 36 RunState run_state; |
| 37 HWND owner; | 37 HWND owner; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Called on the dialog thread to show the actual color chooser. This is | 40 // Called on the dialog thread to show the actual color chooser. This is |
| (...skipping 23 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 // The listener to notify when the user closes the dialog. This may be set to | 65 // The listener to notify when the user closes the dialog. This may be set to |
| 66 // NULL before the color chooser is closed, signalling that the listener no | 66 // NULL before the color chooser is closed, signalling that the listener no |
| 67 // longer cares about the outcome. | 67 // longer cares about the outcome. |
| 68 views::ColorChooserListener* listener_; | 68 views::ColorChooserListener* listener_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(ColorChooserDialog); | 70 DISALLOW_COPY_AND_ASSIGN(ColorChooserDialog); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif // CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ | 73 #endif // CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |
| OLD | NEW |