| OLD | NEW |
| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // animation. | 288 // animation. |
| 289 // TODO(derat): Remove this once we're not using a toplevel X window for the | 289 // TODO(derat): Remove this once we're not using a toplevel X window for the |
| 290 // bubble. | 290 // bubble. |
| 291 SizeToContents(); | 291 SizeToContents(); |
| 292 #else | 292 #else |
| 293 resize_animation_.SetSlideDuration(kPageInfoSlideDuration); | 293 resize_animation_.SetSlideDuration(kPageInfoSlideDuration); |
| 294 resize_animation_.Show(); | 294 resize_animation_.Show(); |
| 295 #endif | 295 #endif |
| 296 } | 296 } |
| 297 | 297 |
| 298 gfx::Point PageInfoBubbleView::GetAnchorPoint() { | 298 gfx::Rect PageInfoBubbleView::GetAnchorRect() { |
| 299 // Compensate for some built-in padding in the icon. | 299 // Compensate for some built-in padding in the icon. |
| 300 gfx::Point anchor(BubbleDelegateView::GetAnchorPoint()); | 300 gfx::Rect anchor(BubbleDelegateView::GetAnchorRect()); |
| 301 return anchor_view() ? anchor.Subtract(gfx::Point(0, 5)) : anchor; | 301 if (anchor_view()) |
| 302 anchor.Offset(0, -5); |
| 303 return anchor; |
| 302 } | 304 } |
| 303 | 305 |
| 304 void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) { | 306 void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) { |
| 305 GURL url = google_util::AppendGoogleLocaleParam( | 307 GURL url = google_util::AppendGoogleLocaleParam( |
| 306 GURL(chrome::kPageInfoHelpCenterURL)); | 308 GURL(chrome::kPageInfoHelpCenterURL)); |
| 307 Browser* browser = BrowserList::GetLastActive(); | 309 Browser* browser = BrowserList::GetLastActive(); |
| 308 browser->OpenURL( | 310 browser->OpenURL( |
| 309 url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); | 311 url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
| 310 // NOTE: The bubble closes automatically on deactivation as the link opens. | 312 // NOTE: The bubble closes automatically on deactivation as the link opens. |
| 311 } | 313 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 const GURL& url, | 475 const GURL& url, |
| 474 const NavigationEntry::SSLStatus& ssl, | 476 const NavigationEntry::SSLStatus& ssl, |
| 475 bool show_history) { | 477 bool show_history) { |
| 476 PageInfoBubbleView* page_info_bubble = | 478 PageInfoBubbleView* page_info_bubble = |
| 477 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); | 479 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); |
| 478 browser::CreateViewsBubble(page_info_bubble); | 480 browser::CreateViewsBubble(page_info_bubble); |
| 479 page_info_bubble->Show(); | 481 page_info_bubble->Show(); |
| 480 } | 482 } |
| 481 | 483 |
| 482 } | 484 } |
| OLD | NEW |