| 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_browser_window_gtk.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/ui/browser_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
| 9 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 9 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
| 10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
| 11 #include "chrome/browser/ui/panels/panel_bounds_animation.h" | 11 #include "chrome/browser/ui/panels/panel_bounds_animation.h" |
| 12 #include "chrome/browser/ui/panels/panel_browser_titlebar_gtk.h" |
| 12 #include "chrome/browser/ui/panels/panel_drag_gtk.h" | 13 #include "chrome/browser/ui/panels/panel_drag_gtk.h" |
| 13 #include "chrome/browser/ui/panels/panel_manager.h" | 14 #include "chrome/browser/ui/panels/panel_manager.h" |
| 14 #include "chrome/browser/ui/panels/panel_strip.h" | 15 #include "chrome/browser/ui/panels/panel_strip.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 17 | 18 |
| 18 using content::WebContents; | 19 using content::WebContents; |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 registrar_.Add( | 84 registrar_.Add( |
| 84 this, | 85 this, |
| 85 chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_MODE, | 86 chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_MODE, |
| 86 content::Source<Panel>(panel_.get())); | 87 content::Source<Panel>(panel_.get())); |
| 87 registrar_.Add( | 88 registrar_.Add( |
| 88 this, | 89 this, |
| 89 chrome::NOTIFICATION_WINDOW_CLOSED, | 90 chrome::NOTIFICATION_WINDOW_CLOSED, |
| 90 content::Source<GtkWindow>(window())); | 91 content::Source<GtkWindow>(window())); |
| 91 } | 92 } |
| 92 | 93 |
| 94 BrowserTitlebar* PanelBrowserWindowGtk::CreateBrowserTitlebar() { |
| 95 return new PanelBrowserTitlebarGtk(this, window()); |
| 96 } |
| 97 |
| 93 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { | 98 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { |
| 94 // Only detect the window edge when panels can be resized by the user. | 99 // Only detect the window edge when panels can be resized by the user. |
| 95 // This method is used by the base class to detect when the cursor has | 100 // This method is used by the base class to detect when the cursor has |
| 96 // hit the window edge in order to change the cursor to a resize cursor | 101 // hit the window edge in order to change the cursor to a resize cursor |
| 97 // and to detect when to initiate a resize drag. | 102 // and to detect when to initiate a resize drag. |
| 98 panel::Resizability resizability = panel_->CanResizeByMouse(); | 103 panel::Resizability resizability = panel_->CanResizeByMouse(); |
| 99 if (panel::NOT_RESIZABLE == resizability) | 104 if (panel::NOT_RESIZABLE == resizability) |
| 100 return false; | 105 return false; |
| 101 | 106 |
| 102 if (!BrowserWindowGtk::GetWindowEdge(x, y, edge)) | 107 if (!BrowserWindowGtk::GetWindowEdge(x, y, edge)) |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 | 737 |
| 733 bool NativePanelTestingGtk::IsAnimatingBounds() const { | 738 bool NativePanelTestingGtk::IsAnimatingBounds() const { |
| 734 return panel_browser_window_gtk_->IsAnimatingBounds(); | 739 return panel_browser_window_gtk_->IsAnimatingBounds(); |
| 735 } | 740 } |
| 736 | 741 |
| 737 bool NativePanelTestingGtk::IsButtonVisible( | 742 bool NativePanelTestingGtk::IsButtonVisible( |
| 738 TitlebarButtonType button_type) const { | 743 TitlebarButtonType button_type) const { |
| 739 NOTIMPLEMENTED(); | 744 NOTIMPLEMENTED(); |
| 740 return true; | 745 return true; |
| 741 } | 746 } |
| OLD | NEW |