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

Unified Diff: chrome/browser/external_tab_container_win.cc

Issue 8508048: Rebase PageInfoBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ShowPageInfoBubble to browser_dialogs.h; adjust anchor. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/external_tab_container_win.cc
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index 2358b014cddd8294de0628924cacc524901fb4b8..1e22bb8a0934d164f6d152844d53811b73e1d65f 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -96,19 +96,21 @@ ContextMenuModel* ConvertMenuModel(const ui::MenuModel* ui_model) {
class ExternalTabPageInfoBubbleView : public PageInfoBubbleView {
public:
ExternalTabPageInfoBubbleView(ExternalTabContainer* container,
- gfx::NativeWindow parent_window,
+ const views::View* anchor_view,
Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
bool show_history)
- : PageInfoBubbleView(parent_window, profile, url, ssl, show_history),
+ : PageInfoBubbleView(anchor_view, profile, url, ssl, show_history),
container_(container) {
DVLOG(1) << __FUNCTION__;
}
+
virtual ~ExternalTabPageInfoBubbleView() {
DVLOG(1) << __FUNCTION__;
}
- // LinkListener methods:
+
+ // views::LinkListener methods:
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE {
GURL url = google_util::AppendGoogleLocaleParam(
GURL(chrome::kPageInfoHelpCenterURL));
@@ -116,6 +118,14 @@ class ExternalTabPageInfoBubbleView : public PageInfoBubbleView {
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK);
}
+
+ // PageInfoBubbleView methods:
+ virtual gfx::Point GetAnchorPoint() OVERRIDE {
+ POINT cursor_pos = {0};
+ GetCursorPos(&cursor_pos);
+ return gfx::Point(cursor_pos);
+ }
+
private:
scoped_refptr<ExternalTabContainer> container_;
};
@@ -591,20 +601,11 @@ void ExternalTabContainer::ShowPageInfo(Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
bool show_history) {
- POINT cursor_pos = {0};
- GetCursorPos(&cursor_pos);
-
- gfx::Rect bounds;
- bounds.set_origin(gfx::Point(cursor_pos));
-
PageInfoBubbleView* page_info_bubble =
new ExternalTabPageInfoBubbleView(this, NULL, profile, url,
ssl, show_history);
- Bubble* bubble = Bubble::Show(GetWidget(), bounds,
- views::BubbleBorder::TOP_LEFT,
- views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR,
- page_info_bubble, page_info_bubble);
- page_info_bubble->set_bubble(bubble);
+ views::BubbleDelegateView::CreateBubble(page_info_bubble);
+ page_info_bubble->Show();
}
void ExternalTabContainer::RegisterRenderViewHostForAutomation(

Powered by Google App Engine
This is Rietveld 408576698