| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/panels/panel_browser_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" | 10 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 // static | 489 // static |
| 490 NativePanelTesting* NativePanelTesting::Create(NativePanel* native_panel) { | 490 NativePanelTesting* NativePanelTesting::Create(NativePanel* native_panel) { |
| 491 return new NativePanelTestingWin(static_cast<PanelBrowserView*>( | 491 return new NativePanelTestingWin(static_cast<PanelBrowserView*>( |
| 492 native_panel)); | 492 native_panel)); |
| 493 } | 493 } |
| 494 | 494 |
| 495 NativePanelTestingWin::NativePanelTestingWin( | 495 NativePanelTestingWin::NativePanelTestingWin( |
| 496 PanelBrowserView* panel_browser_view) : | 496 PanelBrowserView* panel_browser_view) : |
| 497 panel_browser_view_(panel_browser_view) { | 497 panel_browser_view_(panel_browser_view) { |
| 498 PanelBrowserFrameView* frame_view = panel_browser_view_->GetFrameView(); |
| 499 frame_view->title_label_->SetAutoColorReadabilityEnabled(false); |
| 498 } | 500 } |
| 499 | 501 |
| 500 void NativePanelTestingWin::PressLeftMouseButtonTitlebar( | 502 void NativePanelTestingWin::PressLeftMouseButtonTitlebar( |
| 501 const gfx::Point& point) { | 503 const gfx::Point& point) { |
| 502 panel_browser_view_->OnTitlebarMousePressed(point); | 504 panel_browser_view_->OnTitlebarMousePressed(point); |
| 503 } | 505 } |
| 504 | 506 |
| 505 void NativePanelTestingWin::ReleaseMouseButtonTitlebar() { | 507 void NativePanelTestingWin::ReleaseMouseButtonTitlebar() { |
| 506 panel_browser_view_->OnTitlebarMouseReleased(); | 508 panel_browser_view_->OnTitlebarMouseReleased(); |
| 507 } | 509 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 520 } | 522 } |
| 521 | 523 |
| 522 void NativePanelTestingWin::FinishDragTitlebar() { | 524 void NativePanelTestingWin::FinishDragTitlebar() { |
| 523 panel_browser_view_->OnTitlebarMouseReleased(); | 525 panel_browser_view_->OnTitlebarMouseReleased(); |
| 524 } | 526 } |
| 525 | 527 |
| 526 bool NativePanelTestingWin::VerifyDrawingAttention() const { | 528 bool NativePanelTestingWin::VerifyDrawingAttention() const { |
| 527 PanelBrowserFrameView* frame_view = panel_browser_view_->GetFrameView(); | 529 PanelBrowserFrameView* frame_view = panel_browser_view_->GetFrameView(); |
| 528 SkColor attention_color = frame_view->GetTitleColor( | 530 SkColor attention_color = frame_view->GetTitleColor( |
| 529 PanelBrowserFrameView::PAINT_FOR_ATTENTION); | 531 PanelBrowserFrameView::PAINT_FOR_ATTENTION); |
| 530 return attention_color == frame_view->title_label_->GetColor(); | 532 return attention_color == frame_view->title_label_->enabled_color(); |
| 531 } | 533 } |
| 532 | 534 |
| 533 bool NativePanelTestingWin::VerifyActiveState(bool is_active) { | 535 bool NativePanelTestingWin::VerifyActiveState(bool is_active) { |
| 534 PanelBrowserFrameView* frame_view = panel_browser_view_->GetFrameView(); | 536 PanelBrowserFrameView* frame_view = panel_browser_view_->GetFrameView(); |
| 535 | 537 |
| 536 PanelBrowserFrameView::PaintState expected_paint_state = | 538 PanelBrowserFrameView::PaintState expected_paint_state = |
| 537 is_active ? PanelBrowserFrameView::PAINT_AS_ACTIVE | 539 is_active ? PanelBrowserFrameView::PAINT_AS_ACTIVE |
| 538 : PanelBrowserFrameView::PAINT_AS_INACTIVE; | 540 : PanelBrowserFrameView::PAINT_AS_INACTIVE; |
| 539 if (frame_view->paint_state_ != expected_paint_state) | 541 if (frame_view->paint_state_ != expected_paint_state) |
| 540 return false; | 542 return false; |
| 541 | 543 |
| 542 SkColor expected_color = frame_view->GetTitleColor(expected_paint_state); | 544 SkColor expected_color = frame_view->GetTitleColor(expected_paint_state); |
| 543 return expected_color == frame_view->title_label_->GetColor(); | 545 return expected_color == frame_view->title_label_->enabled_color(); |
| 544 } | 546 } |
| 545 | 547 |
| 546 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 548 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 547 return true; | 549 return true; |
| 548 } | 550 } |
| 549 | 551 |
| 550 bool NativePanelTestingWin::IsAnimatingBounds() const { | 552 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 551 return panel_browser_view_->bounds_animator_.get() && | 553 return panel_browser_view_->bounds_animator_.get() && |
| 552 panel_browser_view_->bounds_animator_->is_animating(); | 554 panel_browser_view_->bounds_animator_->is_animating(); |
| 553 } | 555 } |
| OLD | NEW |