| 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.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // The minimized panel should not get the focus. | 55 // The minimized panel should not get the focus. |
| 56 if (expansion_state_ == MINIMIZED) | 56 if (expansion_state_ == MINIMIZED) |
| 57 Deactivate(); | 57 Deactivate(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool Panel::ShouldBringUpTitlebar(int mouse_x, int mouse_y) const { | 60 bool Panel::ShouldBringUpTitlebar(int mouse_x, int mouse_y) const { |
| 61 // Skip the expanded panel. | 61 // Skip the expanded panel. |
| 62 if (expansion_state_ == Panel::EXPANDED) | 62 if (expansion_state_ == Panel::EXPANDED) |
| 63 return false; | 63 return false; |
| 64 | 64 |
| 65 // If the panel is showing titlebar only, we want to keep it up when it is |
| 66 // being dragged. |
| 67 if (expansion_state_ == Panel::TITLE_ONLY && manager()->is_dragging_panel()) |
| 68 return true; |
| 69 |
| 65 // Let the native panel decide. | 70 // Let the native panel decide. |
| 66 return native_panel_->ShouldBringUpPanelTitlebar(mouse_x, mouse_y); | 71 return native_panel_->ShouldBringUpPanelTitlebar(mouse_x, mouse_y); |
| 67 } | 72 } |
| 68 | 73 |
| 69 bool Panel::IsDrawingAttention() const { | 74 bool Panel::IsDrawingAttention() const { |
| 70 return native_panel_->IsDrawingAttention(); | 75 return native_panel_->IsDrawingAttention(); |
| 71 } | 76 } |
| 72 | 77 |
| 73 void Panel::Show() { | 78 void Panel::Show() { |
| 74 native_panel_->ShowPanel(); | 79 native_panel_->ShowPanel(); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 433 } |
| 429 #endif | 434 #endif |
| 430 | 435 |
| 431 Browser* Panel::browser() const { | 436 Browser* Panel::browser() const { |
| 432 return native_panel_->GetPanelBrowser(); | 437 return native_panel_->GetPanelBrowser(); |
| 433 } | 438 } |
| 434 | 439 |
| 435 void Panel::DestroyBrowser() { | 440 void Panel::DestroyBrowser() { |
| 436 native_panel_->DestroyPanelBrowser(); | 441 native_panel_->DestroyPanelBrowser(); |
| 437 } | 442 } |
| OLD | NEW |