| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/panel_controller.h" | 5 #include "chrome/browser/views/panel_controller.h" |
| 6 | 6 |
| 7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 extern "C" { | 8 extern "C" { |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 } | 10 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 g_signal_connect( | 89 g_signal_connect( |
| 90 panel_, "client-event", G_CALLBACK(OnPanelClientEvent), this); | 90 panel_, "client-event", G_CALLBACK(OnPanelClientEvent), this); |
| 91 | 91 |
| 92 title_content_ = new TitleContentView(this); | 92 title_content_ = new TitleContentView(this); |
| 93 title_window_->SetContentsView(title_content_); | 93 title_window_->SetContentsView(title_content_); |
| 94 title_window_->Show(); | 94 title_window_->Show(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void PanelController::UpdateTitleBar() { | 97 void PanelController::UpdateTitleBar() { |
| 98 title_content_->title_label()->SetText( | 98 title_content_->title_label()->SetText(UTF16ToWideHack( |
| 99 UTF16ToWideHack(browser_window_->browser()->GetCurrentPageTitle())); | 99 browser_window_->browser()->GetWindowTitleForCurrentTab())); |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool PanelController::TitleMousePressed(const views::MouseEvent& event) { | 102 bool PanelController::TitleMousePressed(const views::MouseEvent& event) { |
| 103 if (!event.IsOnlyLeftMouseButton()) { | 103 if (!event.IsOnlyLeftMouseButton()) { |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 gfx::Point abs_location = event.location(); | 106 gfx::Point abs_location = event.location(); |
| 107 views::View::ConvertPointToScreen(title_content_, &abs_location); | 107 views::View::ConvertPointToScreen(title_content_, &abs_location); |
| 108 mouse_down_ = true; | 108 mouse_down_ = true; |
| 109 mouse_down_abs_x_ = abs_location.x(); | 109 mouse_down_abs_x_ = abs_location.x(); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void PanelController::TitleContentView::OnMouseReleased( | 229 void PanelController::TitleContentView::OnMouseReleased( |
| 230 const views::MouseEvent& event, bool canceled) { | 230 const views::MouseEvent& event, bool canceled) { |
| 231 return panel_controller_->TitleMouseReleased(event, canceled); | 231 return panel_controller_->TitleMouseReleased(event, canceled); |
| 232 } | 232 } |
| 233 | 233 |
| 234 bool PanelController::TitleContentView::OnMouseDragged( | 234 bool PanelController::TitleContentView::OnMouseDragged( |
| 235 const views::MouseEvent& event) { | 235 const views::MouseEvent& event) { |
| 236 return panel_controller_->TitleMouseDragged(event); | 236 return panel_controller_->TitleMouseDragged(event); |
| 237 } | 237 } |
| 238 | 238 |
| OLD | NEW |