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

Side by Side Diff: ui/views/color_chooser/color_chooser_view.cc

Issue 567463002: Color picker window should not have a minimize button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and Added unit test for minimize button visibility. Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/views/color_chooser/color_chooser_view.h ('k') | ui/views/widget/widget_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/color_chooser/color_chooser_view.h ('k') | ui/views/widget/widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698