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

Side by Side Diff: chrome/browser/ui/views/external_tab_container_win.cc

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. Created 7 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
« no previous file with comments | « chrome/browser/ui/tabs/pinned_tab_codec.cc ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/external_tab_container_win.h" 5 #include "chrome/browser/ui/views/external_tab_container_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <atlconv.h> 9 #include <atlconv.h>
10 #include <atlcrack.h> 10 #include <atlcrack.h>
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 msg.lParam = lparam; 1199 msg.lParam = lparam;
1200 automation_->Send(new AutomationMsg_HandleAccelerator(tab_handle_, msg)); 1200 automation_->Send(new AutomationMsg_HandleAccelerator(tab_handle_, msg));
1201 return true; 1201 return true;
1202 } 1202 }
1203 1203
1204 bool ExternalTabContainerWin::InitNavigationInfo( 1204 bool ExternalTabContainerWin::InitNavigationInfo(
1205 NavigationInfo* nav_info, 1205 NavigationInfo* nav_info,
1206 content::NavigationType nav_type, 1206 content::NavigationType nav_type,
1207 int relative_offset) { 1207 int relative_offset) {
1208 DCHECK(nav_info); 1208 DCHECK(nav_info);
1209 NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); 1209 NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry();
1210 // If this is very early in the game then there may not be an entry. 1210 // If this is very early in the game then there may not be an entry.
1211 if (!entry) 1211 if (!entry)
1212 return false; 1212 return false;
1213 1213
1214 nav_info->navigation_type = nav_type; 1214 nav_info->navigation_type = nav_type;
1215 nav_info->relative_offset = relative_offset; 1215 nav_info->relative_offset = relative_offset;
1216 nav_info->navigation_index = 1216 nav_info->navigation_index =
1217 web_contents_->GetController().GetCurrentEntryIndex(); 1217 web_contents_->GetController().GetCurrentEntryIndex();
1218 nav_info->url = entry->GetURL(); 1218 nav_info->url = entry->GetURL();
1219 nav_info->referrer = entry->GetReferrer().url; 1219 nav_info->referrer = entry->GetReferrer().url;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 if (params.disposition == CURRENT_TAB) { 1474 if (params.disposition == CURRENT_TAB) {
1475 DCHECK(route_all_top_level_navigations_); 1475 DCHECK(route_all_top_level_navigations_);
1476 forward_params.disposition = NEW_FOREGROUND_TAB; 1476 forward_params.disposition = NEW_FOREGROUND_TAB;
1477 } 1477 }
1478 WebContents* new_contents = 1478 WebContents* new_contents =
1479 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); 1479 ExternalTabContainerWin::OpenURLFromTab(source, forward_params);
1480 // support only one navigation for a dummy tab before it is killed. 1480 // support only one navigation for a dummy tab before it is killed.
1481 widget_->CloseNow(); 1481 widget_->CloseNow();
1482 return new_contents; 1482 return new_contents;
1483 } 1483 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/pinned_tab_codec.cc ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698