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

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

Issue 8863009: Fix alignment of avatar bubbles in the NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use Rect::Ofset() Created 9 years 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/page_info_bubble_view.h" 5 #include "chrome/browser/ui/views/page_info_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/certificate_viewer.h" 10 #include "chrome/browser/certificate_viewer.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // animation. 291 // animation.
292 // TODO(derat): Remove this once we're not using a toplevel X window for the 292 // TODO(derat): Remove this once we're not using a toplevel X window for the
293 // bubble. 293 // bubble.
294 SizeToContents(); 294 SizeToContents();
295 #else 295 #else
296 resize_animation_.SetSlideDuration(kPageInfoSlideDuration); 296 resize_animation_.SetSlideDuration(kPageInfoSlideDuration);
297 resize_animation_.Show(); 297 resize_animation_.Show();
298 #endif 298 #endif
299 } 299 }
300 300
301 gfx::Point PageInfoBubbleView::GetAnchorPoint() { 301 gfx::Rect PageInfoBubbleView::GetAnchorRect() {
302 // Compensate for some built-in padding in the icon. 302 // Compensate for some built-in padding in the icon.
303 gfx::Point anchor(BubbleDelegateView::GetAnchorPoint()); 303 gfx::Rect anchor(BubbleDelegateView::GetAnchorRect());
304 return anchor_view() ? anchor.Subtract(gfx::Point(0, 5)) : anchor; 304 if (anchor_view())
305 anchor.Offset(0, -5);
msw 2011/12/08 00:40:14 Please change this to rect.Inset(5, 5); Thanks!
306 return anchor;
305 } 307 }
306 308
307 void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) { 309 void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) {
308 GURL url = google_util::AppendGoogleLocaleParam( 310 GURL url = google_util::AppendGoogleLocaleParam(
309 GURL(chrome::kPageInfoHelpCenterURL)); 311 GURL(chrome::kPageInfoHelpCenterURL));
310 Browser* browser = BrowserList::GetLastActive(); 312 Browser* browser = BrowserList::GetLastActive();
311 browser->OpenURL( 313 browser->OpenURL(
312 url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); 314 url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
313 // NOTE: The bubble closes automatically on deactivation as the link opens. 315 // NOTE: The bubble closes automatically on deactivation as the link opens.
314 } 316 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 const GURL& url, 478 const GURL& url,
477 const NavigationEntry::SSLStatus& ssl, 479 const NavigationEntry::SSLStatus& ssl,
478 bool show_history) { 480 bool show_history) {
479 PageInfoBubbleView* page_info_bubble = 481 PageInfoBubbleView* page_info_bubble =
480 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); 482 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history);
481 browser::CreateViewsBubble(page_info_bubble); 483 browser::CreateViewsBubble(page_info_bubble);
482 page_info_bubble->Show(); 484 page_info_bubble->Show();
483 } 485 }
484 486
485 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698