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

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

Issue 8983010: Convert WebContents to return a content::NavigationController instead of the implementation. Upda... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 11 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/views/location_bar/click_handler.h" 5 #include "chrome/browser/ui/views/location_bar/click_handler.h"
6 6
7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.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/browser/tab_contents/navigation_controller.h"
10 #include "content/browser/tab_contents/tab_contents.h" 9 #include "content/browser/tab_contents/tab_contents.h"
10 #include "content/public/browser/navigation_controller.h"
11 #include "content/public/browser/navigation_entry.h" 11 #include "content/public/browser/navigation_entry.h"
12 #include "ui/views/view.h" 12 #include "ui/views/view.h"
13 13
14 using content::NavigationEntry; 14 using content::NavigationEntry;
15 15
16 ClickHandler::ClickHandler(const views::View* owner, 16 ClickHandler::ClickHandler(const views::View* owner,
17 LocationBarView* location_bar) 17 LocationBarView* location_bar)
18 : owner_(owner), 18 : owner_(owner),
19 location_bar_(location_bar) { 19 location_bar_(location_bar) {
20 } 20 }
21 21
22 void ClickHandler::OnMouseReleased(const views::MouseEvent& event) { 22 void ClickHandler::OnMouseReleased(const views::MouseEvent& event) {
23 if (!owner_->HitTest(event.location())) 23 if (!owner_->HitTest(event.location()))
24 return; 24 return;
25 25
26 // Do not show page info if the user has been editing the location 26 // Do not show page info if the user has been editing the location
27 // bar, or the location bar is at the NTP. 27 // bar, or the location bar is at the NTP.
28 if (location_bar_->location_entry()->IsEditingOrEmpty()) 28 if (location_bar_->location_entry()->IsEditingOrEmpty())
29 return; 29 return;
30 30
31 TabContents* tab = location_bar_->GetTabContentsWrapper()->tab_contents(); 31 TabContents* tab = location_bar_->GetTabContentsWrapper()->tab_contents();
32 NavigationEntry* nav_entry = tab->GetController().GetActiveEntry(); 32 NavigationEntry* nav_entry = tab->GetController().GetActiveEntry();
33 if (!nav_entry) { 33 if (!nav_entry) {
34 NOTREACHED(); 34 NOTREACHED();
35 return; 35 return;
36 } 36 }
37 tab->ShowPageInfo(nav_entry->GetURL(), nav_entry->GetSSL(), true); 37 tab->ShowPageInfo(nav_entry->GetURL(), nav_entry->GetSSL(), true);
38 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698