Chromium Code Reviews| 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_browser_window_gtk.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/panels/panel.h" | 7 #include "chrome/browser/ui/panels/panel.h" |
| 8 #include "chrome/browser/ui/panels/panel_manager.h" | 8 #include "chrome/browser/ui/panels/panel_manager.h" |
| 9 #include "ui/base/dragdrop/gtk_dnd_util.h" | 9 #include "ui/base/dragdrop/gtk_dnd_util.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 G_CALLBACK(OnTitlebarButtonReleaseEventThunk), this); | 60 G_CALLBACK(OnTitlebarButtonReleaseEventThunk), this); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { | 63 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { |
| 64 // Since panels are not resizable or movable by the user, we should not | 64 // Since panels are not resizable or movable by the user, we should not |
| 65 // detect the window edge for behavioral purposes. The edge, if any, | 65 // detect the window edge for behavioral purposes. The edge, if any, |
| 66 // is present only for visual aspects. | 66 // is present only for visual aspects. |
| 67 return FALSE; | 67 return FALSE; |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool PanelBrowserWindowGtk::HandleTitleBarLeftMousePress( | 70 bool PanelBrowserWindowGtk::HandleTitlebarLeftMousePress( |
| 71 GdkEventButton* event, | 71 GdkEventButton* event, |
| 72 guint32 last_click_time, | 72 guint32 last_click_time, |
| 73 gfx::Point last_click_position) { | 73 gfx::Point last_click_position) { |
| 74 // In theory we should never enter this function as we have a handler for | 74 // In theory we should never enter this function as we have a handler for |
| 75 // button press on title bar where we handle this. Not putting NOTREACHED() | 75 // button press on title bar where we handle this. Not putting NOTREACHED() |
| 76 // here because we don't want to crash if hit-testing for title bar in window | 76 // here because we don't want to crash if hit-testing for title bar in window |
| 77 // button press handler in BrowserWindowGtk is off by a pixel or two. | 77 // button press handler in BrowserWindowGtk is off by a pixel or two. |
| 78 DLOG(WARNING) << "Hit-testing for title bar off by a pixel or two?"; | 78 DLOG(WARNING) << "Hit-testing for title bar off by a pixel or two?"; |
| 79 return TRUE; | 79 return TRUE; |
| 80 } | 80 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 | 115 |
| 116 void PanelBrowserWindowGtk::SetPanelBounds(const gfx::Rect& bounds) { | 116 void PanelBrowserWindowGtk::SetPanelBounds(const gfx::Rect& bounds) { |
| 117 SetBounds(bounds); | 117 SetBounds(bounds); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void PanelBrowserWindowGtk::OnPanelExpansionStateChanged( | 120 void PanelBrowserWindowGtk::OnPanelExpansionStateChanged( |
| 121 Panel::ExpansionState expansion_state) { | 121 Panel::ExpansionState expansion_state) { |
| 122 NOTIMPLEMENTED(); | 122 NOTIMPLEMENTED(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool PanelBrowserWindowGtk::ShouldBringUpPanelTitleBar(int mouse_x, | 125 bool PanelBrowserWindowGtk::ShouldBringUpPanelTitlebar(int mouse_x, |
| 126 int mouse_y) const { | 126 int mouse_y) const { |
| 127 NOTIMPLEMENTED(); | 127 NOTIMPLEMENTED(); |
| 128 return false; | 128 return false; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void PanelBrowserWindowGtk::ClosePanel() { | 131 void PanelBrowserWindowGtk::ClosePanel() { |
| 132 Close(); | 132 Close(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void PanelBrowserWindowGtk::ActivatePanel() { | 135 void PanelBrowserWindowGtk::ActivatePanel() { |
| 136 Activate(); | 136 Activate(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void PanelBrowserWindowGtk::DeactivatePanel() { | 139 void PanelBrowserWindowGtk::DeactivatePanel() { |
| 140 Deactivate(); | 140 Deactivate(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool PanelBrowserWindowGtk::IsPanelActive() const { | 143 bool PanelBrowserWindowGtk::IsPanelActive() const { |
| 144 return IsActive(); | 144 return IsActive(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 gfx::NativeWindow PanelBrowserWindowGtk::GetNativePanelHandle() { | 147 gfx::NativeWindow PanelBrowserWindowGtk::GetNativePanelHandle() { |
| 148 return GetNativeHandle(); | 148 return GetNativeHandle(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void PanelBrowserWindowGtk::UpdatePanelTitleBar() { | 151 void PanelBrowserWindowGtk::UpdatePanelTitlebar() { |
|
jianli
2011/08/12 21:34:51
ditto.
prasadt
2011/08/12 21:59:30
Done.
| |
| 152 UpdateTitleBar(); | 152 UpdateTitleBar(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void PanelBrowserWindowGtk::ShowTaskManagerForPanel() { | 155 void PanelBrowserWindowGtk::ShowTaskManagerForPanel() { |
| 156 ShowTaskManager(); | 156 ShowTaskManager(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 FindBar* PanelBrowserWindowGtk::CreatePanelFindBar() { | 159 FindBar* PanelBrowserWindowGtk::CreatePanelFindBar() { |
| 160 return CreateFindBar(); | 160 return CreateFindBar(); |
| 161 } | 161 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 GTK_DRAG_RESULT_USER_CANCELLED); | 383 GTK_DRAG_RESULT_USER_CANCELLED); |
| 384 MessageLoopForUI::current()->RunAllPending(); | 384 MessageLoopForUI::current()->RunAllPending(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void NativePanelTestingGtk::FinishDragTitlebar() { | 387 void NativePanelTestingGtk::FinishDragTitlebar() { |
| 388 panel_browser_window_gtk_->OnDragFailed( | 388 panel_browser_window_gtk_->OnDragFailed( |
| 389 panel_browser_window_gtk_->drag_widget_, NULL, | 389 panel_browser_window_gtk_->drag_widget_, NULL, |
| 390 GTK_DRAG_RESULT_NO_TARGET); | 390 GTK_DRAG_RESULT_NO_TARGET); |
| 391 MessageLoopForUI::current()->RunAllPending(); | 391 MessageLoopForUI::current()->RunAllPending(); |
| 392 } | 392 } |
| OLD | NEW |