Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 &match, NULL); 1759 &match, NULL);
1760 url = match.destination_url; 1760 url = match.destination_url;
1761 } else { 1761 } else {
1762 std::string url_string(reinterpret_cast<char*>(data)); 1762 std::string url_string(reinterpret_cast<char*>(data));
1763 url = GURL(url_string.substr(0, url_string.find_first_of('\n'))); 1763 url = GURL(url_string.substr(0, url_string.find_first_of('\n')));
1764 } 1764 }
1765 if (!url.is_valid()) 1765 if (!url.is_valid())
1766 return false; 1766 return false;
1767 1767
1768 browser::NavigateParams params(window()->browser(), url, 1768 browser::NavigateParams params(window()->browser(), url,
1769 PageTransition::LINK); 1769 content::PAGE_TRANSITION_LINK);
1770 params.tabstrip_index = drop_index; 1770 params.tabstrip_index = drop_index;
1771 1771
1772 if (drop_before) { 1772 if (drop_before) {
1773 params.disposition = NEW_FOREGROUND_TAB; 1773 params.disposition = NEW_FOREGROUND_TAB;
1774 } else { 1774 } else {
1775 params.disposition = CURRENT_TAB; 1775 params.disposition = CURRENT_TAB;
1776 params.source_contents = model_->GetTabContentsAt(drop_index); 1776 params.source_contents = model_->GetTabContentsAt(drop_index);
1777 } 1777 }
1778 1778
1779 browser::Navigate(&params); 1779 browser::Navigate(&params);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 break; 2130 break;
2131 case 2: { 2131 case 2: {
2132 // On middle-click, try to parse the PRIMARY selection as a URL and load 2132 // On middle-click, try to parse the PRIMARY selection as a URL and load
2133 // it instead of creating a blank page. 2133 // it instead of creating a blank page.
2134 GURL url; 2134 GURL url;
2135 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url)) 2135 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
2136 return; 2136 return;
2137 2137
2138 Browser* browser = window_->browser(); 2138 Browser* browser = window_->browser();
2139 DCHECK(browser); 2139 DCHECK(browser);
2140 browser->AddSelectedTabWithURL(url, PageTransition::TYPED); 2140 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_TYPED);
2141 break; 2141 break;
2142 } 2142 }
2143 default: 2143 default:
2144 NOTREACHED() << "Got click on new tab button with unhandled mouse " 2144 NOTREACHED() << "Got click on new tab button with unhandled mouse "
2145 << "button " << mouse_button; 2145 << "button " << mouse_button;
2146 } 2146 }
2147 } 2147 }
2148 2148
2149 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { 2149 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) {
2150 gfx::Rect bds = bounds; 2150 gfx::Rect bds = bounds;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 2186
2187 // Let the middle mouse button initiate clicks as well. 2187 // Let the middle mouse button initiate clicks as well.
2188 gtk_util::SetButtonTriggersNavigation(button->widget()); 2188 gtk_util::SetButtonTriggersNavigation(button->widget());
2189 g_signal_connect(button->widget(), "clicked", 2189 g_signal_connect(button->widget(), "clicked",
2190 G_CALLBACK(OnNewTabClickedThunk), this); 2190 G_CALLBACK(OnNewTabClickedThunk), this);
2191 gtk_widget_set_can_focus(button->widget(), FALSE); 2191 gtk_widget_set_can_focus(button->widget(), FALSE);
2192 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); 2192 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0);
2193 2193
2194 return button; 2194 return button;
2195 } 2195 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc ('k') | chrome/browser/ui/gtk/view_id_util_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698