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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_info_helper.cc

Issue 22831005: Use visible entry for website settings dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TabSpecificContentSettings Created 7 years, 4 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/gtk/location_bar_view_gtk.cc ('k') | no next file » | 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/location_bar/page_info_helper.h" 5 #include "chrome/browser/ui/views/location_bar/page_info_helper.h"
6 6
7 #include "chrome/browser/ui/omnibox/omnibox_view.h" 7 #include "chrome/browser/ui/omnibox/omnibox_view.h"
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
9 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/browser/navigation_entry.h" 10 #include "content/public/browser/navigation_entry.h"
(...skipping 16 matching lines...) Expand all
27 27
28 // Do not show page info if the user has been editing the location 28 // Do not show page info if the user has been editing the location
29 // bar, or the location bar is at the NTP. 29 // bar, or the location bar is at the NTP.
30 if (location_bar_->GetLocationEntry()->IsEditingOrEmpty()) 30 if (location_bar_->GetLocationEntry()->IsEditingOrEmpty())
31 return; 31 return;
32 32
33 WebContents* tab = location_bar_->GetWebContents(); 33 WebContents* tab = location_bar_->GetWebContents();
34 if (!tab) 34 if (!tab)
35 return; 35 return;
36 const NavigationController& controller = tab->GetController(); 36 const NavigationController& controller = tab->GetController();
37 NavigationEntry* nav_entry = controller.GetActiveEntry(); 37 // Important to use GetVisibleEntry to match what's showing in the omnibox.
38 NavigationEntry* nav_entry = controller.GetVisibleEntry();
38 if (!nav_entry) { 39 if (!nav_entry) {
39 NOTREACHED(); 40 NOTREACHED();
40 return; 41 return;
41 } 42 }
42 43
43 location_bar_->delegate()->ShowWebsiteSettings( 44 location_bar_->delegate()->ShowWebsiteSettings(
44 tab, nav_entry->GetURL(), nav_entry->GetSSL()); 45 tab, nav_entry->GetURL(), nav_entry->GetSSL());
45 } 46 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698