| 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/views/panels/panel_view.h" | 5 #include "chrome/browser/ui/views/panels/panel_view.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 679 |
| 680 // Expand the panel if the minimized panel is activated by means other than | 680 // Expand the panel if the minimized panel is activated by means other than |
| 681 // clicking on its titlebar. This is the workaround to support restoring the | 681 // clicking on its titlebar. This is the workaround to support restoring the |
| 682 // minimized panel by other means, like alt-tabbing, win-tabbing, or clicking | 682 // minimized panel by other means, like alt-tabbing, win-tabbing, or clicking |
| 683 // the taskbar icon. Note that this workaround does not work for one edge | 683 // the taskbar icon. Note that this workaround does not work for one edge |
| 684 // case: the mouse happens to be at the minimized panel when the user tries to | 684 // case: the mouse happens to be at the minimized panel when the user tries to |
| 685 // bring up the panel with the above alternatives. | 685 // bring up the panel with the above alternatives. |
| 686 // When the user clicks on the minimized panel, the panel expansion will be | 686 // When the user clicks on the minimized panel, the panel expansion will be |
| 687 // done when we process the mouse button pressed message. | 687 // done when we process the mouse button pressed message. |
| 688 if (focused_ && panel_->IsMinimized() && | 688 if (focused_ && panel_->IsMinimized() && |
| 689 gfx::Screen::GetWindowAtCursorScreenPoint() != | 689 gfx::Screen::GetScreenFor(widget->GetNativeWindow())-> |
| 690 widget->GetNativeWindow()) { | 690 GetWindowAtCursorScreenPoint() != widget->GetNativeWindow()) { |
| 691 panel_->Restore(); | 691 panel_->Restore(); |
| 692 } | 692 } |
| 693 | 693 |
| 694 panel()->OnActiveStateChanged(focused); | 694 panel()->OnActiveStateChanged(focused); |
| 695 } | 695 } |
| 696 | 696 |
| 697 bool PanelView::OnTitlebarMousePressed(const gfx::Point& mouse_location) { | 697 bool PanelView::OnTitlebarMousePressed(const gfx::Point& mouse_location) { |
| 698 mouse_pressed_ = true; | 698 mouse_pressed_ = true; |
| 699 mouse_dragging_state_ = NO_DRAGGING; | 699 mouse_dragging_state_ = NO_DRAGGING; |
| 700 last_mouse_location_ = mouse_location; | 700 last_mouse_location_ = mouse_location; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 int height = web_view_->size().height(); | 818 int height = web_view_->size().height(); |
| 819 SkRegion* region = new SkRegion; | 819 SkRegion* region = new SkRegion; |
| 820 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); | 820 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); |
| 821 region->op(width - kResizeInsideBoundsSize, 0, width, height, | 821 region->op(width - kResizeInsideBoundsSize, 0, width, height, |
| 822 SkRegion::kUnion_Op); | 822 SkRegion::kUnion_Op); |
| 823 region->op(0, height - kResizeInsideBoundsSize, width, height, | 823 region->op(0, height - kResizeInsideBoundsSize, width, height, |
| 824 SkRegion::kUnion_Op); | 824 SkRegion::kUnion_Op); |
| 825 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); | 825 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); |
| 826 #endif | 826 #endif |
| 827 } | 827 } |
| OLD | NEW |