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/gtk/browser_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
6 | 6 |
7 #include <X11/XF86keysym.h> | 7 #include <X11/XF86keysym.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 // BrowserToolbarGtk, private -------------------------------------------------- | 418 // BrowserToolbarGtk, private -------------------------------------------------- |
419 | 419 |
420 void BrowserToolbarGtk::SetUpDragForHomeButton(bool enable) { | 420 void BrowserToolbarGtk::SetUpDragForHomeButton(bool enable) { |
421 if (enable) { | 421 if (enable) { |
422 gtk_drag_dest_set(home_->widget(), GTK_DEST_DEFAULT_ALL, | 422 gtk_drag_dest_set(home_->widget(), GTK_DEST_DEFAULT_ALL, |
423 NULL, 0, GDK_ACTION_COPY); | 423 NULL, 0, GDK_ACTION_COPY); |
424 static const int targets[] = { ui::TEXT_PLAIN, ui::TEXT_URI_LIST, -1 }; | 424 static const int targets[] = { ui::TEXT_PLAIN, ui::TEXT_URI_LIST, -1 }; |
425 ui::SetDestTargetList(home_->widget(), targets); | 425 ui::SetDestTargetList(home_->widget(), targets); |
426 | 426 |
427 drop_handler_.reset(new GtkSignalRegistrar()); | 427 drop_handler_.reset(new ui::GtkSignalRegistrar()); |
428 drop_handler_->Connect(home_->widget(), "drag-data-received", | 428 drop_handler_->Connect(home_->widget(), "drag-data-received", |
429 G_CALLBACK(OnDragDataReceivedThunk), this); | 429 G_CALLBACK(OnDragDataReceivedThunk), this); |
430 } else { | 430 } else { |
431 gtk_drag_dest_unset(home_->widget()); | 431 gtk_drag_dest_unset(home_->widget()); |
432 drop_handler_.reset(NULL); | 432 drop_handler_.reset(NULL); |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
436 bool BrowserToolbarGtk::UpdateRoundedness() { | 436 bool BrowserToolbarGtk::UpdateRoundedness() { |
437 // We still round the corners if we are in chrome theme mode, but we do it by | 437 // We still round the corners if we are in chrome theme mode, but we do it by |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 int x_offset = base::i18n::IsRTL() ? 0 : | 651 int x_offset = base::i18n::IsRTL() ? 0 : |
652 sender->allocation.width - badge->width(); | 652 sender->allocation.width - badge->width(); |
653 int y_offset = 0; | 653 int y_offset = 0; |
654 canvas.DrawBitmapInt( | 654 canvas.DrawBitmapInt( |
655 *badge, | 655 *badge, |
656 sender->allocation.x + x_offset, | 656 sender->allocation.x + x_offset, |
657 sender->allocation.y + y_offset); | 657 sender->allocation.y + y_offset); |
658 | 658 |
659 return FALSE; | 659 return FALSE; |
660 } | 660 } |
OLD | NEW |