| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 644 |
| 645 // Expand the panel if the minimized panel is activated by means other than | 645 // Expand the panel if the minimized panel is activated by means other than |
| 646 // clicking on its titlebar. This is the workaround to support restoring the | 646 // clicking on its titlebar. This is the workaround to support restoring the |
| 647 // minimized panel by other means, like alt-tabbing, win-tabbing, or clicking | 647 // minimized panel by other means, like alt-tabbing, win-tabbing, or clicking |
| 648 // the taskbar icon. Note that this workaround does not work for one edge | 648 // the taskbar icon. Note that this workaround does not work for one edge |
| 649 // case: the mouse happens to be at the minimized panel when the user tries to | 649 // case: the mouse happens to be at the minimized panel when the user tries to |
| 650 // bring up the panel with the above alternatives. | 650 // bring up the panel with the above alternatives. |
| 651 // When the user clicks on the minimized panel, the panel expansion will be | 651 // When the user clicks on the minimized panel, the panel expansion will be |
| 652 // done when we process the mouse button pressed message. | 652 // done when we process the mouse button pressed message. |
| 653 if (focused_ && panel_->IsMinimized() && | 653 if (focused_ && panel_->IsMinimized() && |
| 654 gfx::Screen::GetWindowAtCursorScreenPoint() != | 654 gfx::Screen::GetWindowAtCursorScreenPoint( |
| 655 widget->GetNativeWindow()) { | 655 gfx::Screen::BadTwoWorldsContext()) != |
| 656 widget->GetNativeWindow()) { |
| 656 panel_->Restore(); | 657 panel_->Restore(); |
| 657 } | 658 } |
| 658 | 659 |
| 659 panel()->OnActiveStateChanged(focused); | 660 panel()->OnActiveStateChanged(focused); |
| 660 } | 661 } |
| 661 | 662 |
| 662 bool PanelView::OnTitlebarMousePressed(const gfx::Point& mouse_location) { | 663 bool PanelView::OnTitlebarMousePressed(const gfx::Point& mouse_location) { |
| 663 mouse_pressed_ = true; | 664 mouse_pressed_ = true; |
| 664 mouse_dragging_state_ = NO_DRAGGING; | 665 mouse_dragging_state_ = NO_DRAGGING; |
| 665 last_mouse_location_ = mouse_location; | 666 last_mouse_location_ = mouse_location; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 int height = web_view_->size().height(); | 784 int height = web_view_->size().height(); |
| 784 SkRegion* region = new SkRegion; | 785 SkRegion* region = new SkRegion; |
| 785 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); | 786 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); |
| 786 region->op(width - kResizeInsideBoundsSize, 0, width, height, | 787 region->op(width - kResizeInsideBoundsSize, 0, width, height, |
| 787 SkRegion::kUnion_Op); | 788 SkRegion::kUnion_Op); |
| 788 region->op(0, height - kResizeInsideBoundsSize, width, height, | 789 region->op(0, height - kResizeInsideBoundsSize, width, height, |
| 789 SkRegion::kUnion_Op); | 790 SkRegion::kUnion_Op); |
| 790 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); | 791 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); |
| 791 #endif | 792 #endif |
| 792 } | 793 } |
| OLD | NEW |