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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 GtkSelectionData* data, guint info, guint time) { | 599 GtkSelectionData* data, guint info, guint time) { |
600 if (info != ui::TEXT_PLAIN) { | 600 if (info != ui::TEXT_PLAIN) { |
601 NOTIMPLEMENTED() << "Only support plain text drops for now, sorry!"; | 601 NOTIMPLEMENTED() << "Only support plain text drops for now, sorry!"; |
602 return; | 602 return; |
603 } | 603 } |
604 | 604 |
605 GURL url(reinterpret_cast<char*>(data->data)); | 605 GURL url(reinterpret_cast<char*>(data->data)); |
606 if (!url.is_valid()) | 606 if (!url.is_valid()) |
607 return; | 607 return; |
608 | 608 |
609 bool url_is_newtab = url.spec() == chrome::kChromeUINewTabURL; | 609 bool url_is_newtab = url == GURL(chrome::kChromeUINewTabURL); |
Evan Stade
2011/05/20 05:18:43
sorry, I guess I was unclear during our chat. I co
msw
2011/05/22 01:12:12
Done.
| |
610 home_page_is_new_tab_page_.SetValue(url_is_newtab); | 610 home_page_is_new_tab_page_.SetValue(url_is_newtab); |
611 if (!url_is_newtab) | 611 if (!url_is_newtab) |
612 home_page_.SetValue(url.spec()); | 612 home_page_.SetValue(url.spec()); |
613 } | 613 } |
614 | 614 |
615 void BrowserToolbarGtk::NotifyPrefChanged(const std::string* pref) { | 615 void BrowserToolbarGtk::NotifyPrefChanged(const std::string* pref) { |
616 if (!pref || *pref == prefs::kShowHomeButton) { | 616 if (!pref || *pref == prefs::kShowHomeButton) { |
617 if (show_home_button_.GetValue() && !ShouldOnlyShowLocation()) { | 617 if (show_home_button_.GetValue() && !ShouldOnlyShowLocation()) { |
618 gtk_widget_show(home_->widget()); | 618 gtk_widget_show(home_->widget()); |
619 } else { | 619 } else { |
(...skipping 29 matching lines...) Expand all Loading... | |
649 int x_offset = base::i18n::IsRTL() ? 0 : | 649 int x_offset = base::i18n::IsRTL() ? 0 : |
650 sender->allocation.width - badge->width(); | 650 sender->allocation.width - badge->width(); |
651 int y_offset = 0; | 651 int y_offset = 0; |
652 canvas.DrawBitmapInt( | 652 canvas.DrawBitmapInt( |
653 *badge, | 653 *badge, |
654 sender->allocation.x + x_offset, | 654 sender->allocation.x + x_offset, |
655 sender->allocation.y + y_offset); | 655 sender->allocation.y + y_offset); |
656 | 656 |
657 return FALSE; | 657 return FALSE; |
658 } | 658 } |
OLD | NEW |