| 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/gtk/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/browser_navigator.h" | 25 #include "chrome/browser/ui/browser_navigator.h" |
| 26 #include "chrome/browser/ui/browser_tabstrip.h" | 26 #include "chrome/browser/ui/browser_tabstrip.h" |
| 27 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 27 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 28 #include "chrome/browser/ui/gtk/custom_button.h" | 28 #include "chrome/browser/ui/gtk/custom_button.h" |
| 29 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 29 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 30 #include "chrome/browser/ui/gtk/gtk_util.h" | 30 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 31 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" | 31 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" |
| 32 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h" | 32 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h" |
| 33 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 34 #include "chrome/browser/ui/tab_contents/tab_contents.h" | |
| 35 #include "chrome/common/chrome_notification_types.h" | 35 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "content/public/browser/notification_source.h" | 36 #include "content/public/browser/notification_source.h" |
| 37 #include "content/public/browser/user_metrics.h" | 37 #include "content/public/browser/user_metrics.h" |
| 38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "grit/generated_resources.h" | 39 #include "grit/generated_resources.h" |
| 40 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
| 41 #include "grit/theme_resources_standard.h" | 41 #include "grit/theme_resources_standard.h" |
| 42 #include "grit/ui_resources.h" | 42 #include "grit/ui_resources.h" |
| 43 #include "ui/base/animation/animation_delegate.h" | 43 #include "ui/base/animation/animation_delegate.h" |
| 44 #include "ui/base/animation/slide_animation.h" | 44 #include "ui/base/animation/slide_animation.h" |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 UTF8ToUTF16(reinterpret_cast<const char*>(data)), string16(), | 1781 UTF8ToUTF16(reinterpret_cast<const char*>(data)), string16(), |
| 1782 false, false, &match, NULL); | 1782 false, false, &match, NULL); |
| 1783 url = match.destination_url; | 1783 url = match.destination_url; |
| 1784 } else { | 1784 } else { |
| 1785 std::string url_string(reinterpret_cast<const char*>(data)); | 1785 std::string url_string(reinterpret_cast<const char*>(data)); |
| 1786 url = GURL(url_string.substr(0, url_string.find_first_of('\n'))); | 1786 url = GURL(url_string.substr(0, url_string.find_first_of('\n'))); |
| 1787 } | 1787 } |
| 1788 if (!url.is_valid()) | 1788 if (!url.is_valid()) |
| 1789 return false; | 1789 return false; |
| 1790 | 1790 |
| 1791 browser::NavigateParams params(window()->browser(), url, | 1791 chrome::NavigateParams params(window()->browser(), url, |
| 1792 content::PAGE_TRANSITION_LINK); | 1792 content::PAGE_TRANSITION_LINK); |
| 1793 params.tabstrip_index = drop_index; | 1793 params.tabstrip_index = drop_index; |
| 1794 | 1794 |
| 1795 if (drop_before) { | 1795 if (drop_before) { |
| 1796 params.disposition = NEW_FOREGROUND_TAB; | 1796 params.disposition = NEW_FOREGROUND_TAB; |
| 1797 } else { | 1797 } else { |
| 1798 params.disposition = CURRENT_TAB; | 1798 params.disposition = CURRENT_TAB; |
| 1799 params.source_contents = model_->GetTabContentsAt(drop_index); | 1799 params.source_contents = model_->GetTabContentsAt(drop_index); |
| 1800 } | 1800 } |
| 1801 | 1801 |
| 1802 browser::Navigate(¶ms); | 1802 chrome::Navigate(¶ms); |
| 1803 | 1803 |
| 1804 return true; | 1804 return true; |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 // static | 1807 // static |
| 1808 gfx::Image* TabStripGtk::GetDropArrowImage(bool is_down) { | 1808 gfx::Image* TabStripGtk::GetDropArrowImage(bool is_down) { |
| 1809 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1809 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 1810 is_down ? IDR_TAB_DROP_DOWN : IDR_TAB_DROP_UP); | 1810 is_down ? IDR_TAB_DROP_DOWN : IDR_TAB_DROP_UP); |
| 1811 } | 1811 } |
| 1812 | 1812 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2266 } | 2266 } |
| 2267 | 2267 |
| 2268 void TabStripGtk::SetNewTabButtonBackground() { | 2268 void TabStripGtk::SetNewTabButtonBackground() { |
| 2269 SkColor color = theme_service_->GetColor( | 2269 SkColor color = theme_service_->GetColor( |
| 2270 ThemeService::COLOR_BUTTON_BACKGROUND); | 2270 ThemeService::COLOR_BUTTON_BACKGROUND); |
| 2271 SkBitmap* background = theme_service_->GetBitmapNamed( | 2271 SkBitmap* background = theme_service_->GetBitmapNamed( |
| 2272 IDR_THEME_WINDOW_CONTROL_BACKGROUND); | 2272 IDR_THEME_WINDOW_CONTROL_BACKGROUND); |
| 2273 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); | 2273 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); |
| 2274 newtab_button_->SetBackground(color, background, mask); | 2274 newtab_button_->SetBackground(color, background, mask); |
| 2275 } | 2275 } |
| OLD | NEW |