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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 8265005: first run bubble using the views/bubble api. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update 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/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 158738d6e0ba1f69288045e28416e6f438bd4084..6145faf3a6cfdcdb631a9677936cf8a9a08777e6 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -61,8 +61,11 @@
#include "views/controls/textfield/native_textfield_views.h"
#include "views/drag_utils.h"
-#if defined(OS_WIN)
+#if !defined(OS_CHROMEOS)
Miranda Callahan 2011/11/11 15:26:24 This shouldn't be included for OS_MAC, either.
msw 2011/11/11 19:05:25 I don't think we typically need to explicitly excl
Miranda Callahan 2011/11/11 20:04:46 Oh, good point -- we're already in /views, so we d
alicet1 2011/11/12 00:03:51 I think the mac branch is under http://src.chromiu
#include "chrome/browser/ui/views/first_run_bubble.h"
+#endif
+
+#if defined(OS_WIN)
#include "chrome/browser/ui/views/location_bar/suggested_text_view.h"
#endif
@@ -991,14 +994,18 @@ void LocationBarView::OnMouseEvent(const views::MouseEvent& event, UINT msg) {
void LocationBarView::ShowFirstRunBubbleInternal(
FirstRun::BubbleType bubble_type) {
-#if defined(OS_WIN) // First run bubble doesn't make sense for Chrome OS.
- // Point at the start of the edit control; adjust to look as good as possible.
- const int kXOffset = kNormalHorizontalEdgeThickness + kEdgeItemPadding +
- ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_OMNIBOX_HTTP)->width() + kItemPadding;
- const int kYOffset = -(kVerticalEdgeThickness + 2);
- gfx::Point origin(location_entry_view_->bounds().x() + kXOffset,
- y() + height() + kYOffset);
+#if !defined(OS_CHROMEOS)
+ // First run bubble doesn't make sense for Chrome OS.
+ // Point at the base of the omnibox icon. location_icon_view_ height
+ // already includes padding, we want the tip of the bubble to be closer
+ // to the height the bitmap instead.
Miranda Callahan 2011/11/11 15:26:24 s/height the/height of the/
alicet1 2011/11/12 00:03:51 Done.
+ const int kXOffset = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_OMNIBOX_HTTP)->width() / 2;
+ const int icon_height = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_OMNIBOX_HTTP)->height();
+ const int kYOffset = (location_icon_view_->height() + icon_height) / 2;
+ gfx::Point origin(location_icon_view_->bounds().x() + kXOffset,
+ location_icon_view_->bounds().y() + kYOffset);
// If the UI layout is RTL, the coordinate system is not transformed and
// therefore we need to adjust the X coordinate so that bubble appears on the
// right hand side of the location bar.
@@ -1007,7 +1014,8 @@ void LocationBarView::ShowFirstRunBubbleInternal(
views::View::ConvertPointToScreen(this, &origin);
FirstRunBubble::Show(browser_->profile(), GetWidget(),
Miranda Callahan 2011/11/11 15:26:24 if you're going to have the args each on one line
alicet1 2011/11/12 00:03:51 Done.
gfx::Rect(origin, gfx::Size()),
- views::BubbleBorder::TOP_LEFT, bubble_type);
+ views::BubbleBorder::TOP_LEFT,
+ bubble_type);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698