This source file includes following definitions.
- location_bar_
- ProcessEvent
#include "chrome/browser/ui/views/location_bar/page_info_helper.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/omnibox/omnibox_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "ui/views/view.h"
using content::NavigationController;
using content::NavigationEntry;
using content::WebContents;
PageInfoHelper::PageInfoHelper(const views::View* owner,
LocationBarView* location_bar)
: owner_(owner),
location_bar_(location_bar) {
}
void PageInfoHelper::ProcessEvent(const ui::LocatedEvent& event) {
if (!owner_->HitTestPoint(event.location()))
return;
WebContents* tab = location_bar_->GetWebContents();
if (!tab)
return;
const NavigationController& controller = tab->GetController();
NavigationEntry* nav_entry = controller.GetVisibleEntry();
DCHECK(nav_entry);
location_bar_->delegate()->ShowWebsiteSettings(
tab, nav_entry->GetURL(), nav_entry->GetSSL());
}