| 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 #include "ui/views/color_chooser/color_chooser_view.h" | 5 #include "ui/views/color_chooser/color_chooser_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 SkScalar value) { | 430 SkScalar value) { |
| 431 hsv_[1] = saturation; | 431 hsv_[1] = saturation; |
| 432 hsv_[2] = value; | 432 hsv_[2] = value; |
| 433 SkColor color = SkHSVToColor(255, hsv_); | 433 SkColor color = SkHSVToColor(255, hsv_); |
| 434 if (listener_) | 434 if (listener_) |
| 435 listener_->OnColorChosen(color); | 435 listener_->OnColorChosen(color); |
| 436 selected_color_patch_->SetColor(color); | 436 selected_color_patch_->SetColor(color); |
| 437 textfield_->SetText(GetColorText(color)); | 437 textfield_->SetText(GetColorText(color)); |
| 438 } | 438 } |
| 439 | 439 |
| 440 bool ColorChooserView::CanMinimize() const { |
| 441 return false; |
| 442 } |
| 443 |
| 440 View* ColorChooserView::GetInitiallyFocusedView() { | 444 View* ColorChooserView::GetInitiallyFocusedView() { |
| 441 return textfield_; | 445 return textfield_; |
| 442 } | 446 } |
| 443 | 447 |
| 444 ui::ModalType ColorChooserView::GetModalType() const { | 448 ui::ModalType ColorChooserView::GetModalType() const { |
| 445 return ui::MODAL_TYPE_WINDOW; | 449 return ui::MODAL_TYPE_WINDOW; |
| 446 } | 450 } |
| 447 | 451 |
| 448 void ColorChooserView::WindowClosing() { | 452 void ColorChooserView::WindowClosing() { |
| 449 if (listener_) | 453 if (listener_) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 472 const ui::KeyEvent& key_event) { | 476 const ui::KeyEvent& key_event) { |
| 473 if (key_event.key_code() != ui::VKEY_RETURN && | 477 if (key_event.key_code() != ui::VKEY_RETURN && |
| 474 key_event.key_code() != ui::VKEY_ESCAPE) | 478 key_event.key_code() != ui::VKEY_ESCAPE) |
| 475 return false; | 479 return false; |
| 476 | 480 |
| 477 GetWidget()->Close(); | 481 GetWidget()->Close(); |
| 478 return true; | 482 return true; |
| 479 } | 483 } |
| 480 | 484 |
| 481 } // namespace views | 485 } // namespace views |
| OLD | NEW |