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 "chrome/browser/ui/panels/panel_frame_view.h" | 5 #include "chrome/browser/ui/panels/panel_frame_view.h" |
6 | 6 |
7 #include "chrome/browser/themes/theme_service.h" | 7 #include "chrome/browser/themes/theme_service.h" |
8 #include "chrome/browser/themes/theme_service_factory.h" | 8 #include "chrome/browser/themes/theme_service_factory.h" |
9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
10 #include "chrome/browser/ui/panels/panel_constants.h" | 10 #include "chrome/browser/ui/panels/panel_constants.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 NonClientFrameView::OnMouseReleased(event); | 459 NonClientFrameView::OnMouseReleased(event); |
460 } | 460 } |
461 | 461 |
462 void PanelFrameView::OnMouseCaptureLost() { | 462 void PanelFrameView::OnMouseCaptureLost() { |
463 if (panel_view_->OnTitlebarMouseCaptureLost()) | 463 if (panel_view_->OnTitlebarMouseCaptureLost()) |
464 return; | 464 return; |
465 NonClientFrameView::OnMouseCaptureLost(); | 465 NonClientFrameView::OnMouseCaptureLost(); |
466 } | 466 } |
467 | 467 |
468 void PanelFrameView::ButtonPressed(views::Button* sender, | 468 void PanelFrameView::ButtonPressed(views::Button* sender, |
469 const views::Event& event) { | 469 const ui::Event& event) { |
470 if (sender == close_button_) { | 470 if (sender == close_button_) { |
471 panel_view_->ClosePanel(); | 471 panel_view_->ClosePanel(); |
472 } else { | 472 } else { |
473 panel::ClickModifier modifier = | 473 panel::ClickModifier modifier = |
474 event.IsControlDown() ? panel::APPLY_TO_ALL : panel::NO_MODIFIER; | 474 event.IsControlDown() ? panel::APPLY_TO_ALL : panel::NO_MODIFIER; |
475 if (sender == minimize_button_) | 475 if (sender == minimize_button_) |
476 panel_view_->panel()->OnMinimizeButtonClicked(modifier); | 476 panel_view_->panel()->OnMinimizeButtonClicked(modifier); |
477 else if (sender == restore_button_) | 477 else if (sender == restore_button_) |
478 panel_view_->panel()->OnRestoreButtonClicked(modifier); | 478 panel_view_->panel()->OnRestoreButtonClicked(modifier); |
479 } | 479 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 625 |
626 void PanelFrameView::PaintDivider(gfx::Canvas* canvas) { | 626 void PanelFrameView::PaintDivider(gfx::Canvas* canvas) { |
627 // Draw the divider between the titlebar and the client area only if the panel | 627 // Draw the divider between the titlebar and the client area only if the panel |
628 // is big enough to show more than the titlebar. | 628 // is big enough to show more than the titlebar. |
629 if (height() > TitlebarHeight()) { | 629 if (height() > TitlebarHeight()) { |
630 canvas->DrawLine(gfx::Point(0, panel::kTitlebarHeight - 1), | 630 canvas->DrawLine(gfx::Point(0, panel::kTitlebarHeight - 1), |
631 gfx::Point(width() - 1, panel::kTitlebarHeight - 1), | 631 gfx::Point(width() - 1, panel::kTitlebarHeight - 1), |
632 kDividerColor); | 632 kDividerColor); |
633 } | 633 } |
634 } | 634 } |
OLD | NEW |