Chromium Code Reviews| 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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 #include "ui/base/theme_provider.h" | 54 #include "ui/base/theme_provider.h" |
| 55 #include "ui/gfx/canvas_skia.h" | 55 #include "ui/gfx/canvas_skia.h" |
| 56 #include "ui/gfx/color_utils.h" | 56 #include "ui/gfx/color_utils.h" |
| 57 #include "ui/gfx/image/image.h" | 57 #include "ui/gfx/image/image.h" |
| 58 #include "ui/gfx/skia_util.h" | 58 #include "ui/gfx/skia_util.h" |
| 59 #include "views/bubble/bubble_border.h" | 59 #include "views/bubble/bubble_border.h" |
| 60 #include "views/controls/label.h" | 60 #include "views/controls/label.h" |
| 61 #include "views/controls/textfield/native_textfield_views.h" | 61 #include "views/controls/textfield/native_textfield_views.h" |
| 62 #include "views/drag_utils.h" | 62 #include "views/drag_utils.h" |
| 63 | 63 |
| 64 #if defined(OS_WIN) || !defined(OS_CHROMEOS) | |
|
msw
2011/10/20 19:17:50
Shouldn't this just be: "#if !defined(OS_CHROMEOS)
alicet1
2011/10/21 19:13:16
Done.
| |
| 65 #include "chrome/browser/ui/views/first_run_bubble.h" | |
| 66 #endif | |
| 67 | |
| 64 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
| 65 #include "chrome/browser/ui/views/first_run_bubble.h" | |
| 66 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" | 69 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" |
| 67 #endif | 70 #endif |
| 68 | 71 |
| 69 using views::View; | 72 using views::View; |
| 70 | 73 |
| 71 namespace { | 74 namespace { |
| 72 | 75 |
| 73 TabContents* GetTabContentsFromDelegate(LocationBarView::Delegate* delegate) { | 76 TabContents* GetTabContentsFromDelegate(LocationBarView::Delegate* delegate) { |
| 74 const TabContentsWrapper* wrapper = delegate->GetTabContentsWrapper(); | 77 const TabContentsWrapper* wrapper = delegate->GetTabContentsWrapper(); |
| 75 return wrapper ? wrapper->tab_contents() : NULL; | 78 return wrapper ? wrapper->tab_contents() : NULL; |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 ConvertPointToScreen(this, &screen_point); | 1014 ConvertPointToScreen(this, &screen_point); |
| 1012 if (views::Widget::IsPureViews()) | 1015 if (views::Widget::IsPureViews()) |
| 1013 NOTIMPLEMENTED(); | 1016 NOTIMPLEMENTED(); |
| 1014 else | 1017 else |
| 1015 GetOmniboxViewWin()->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); | 1018 GetOmniboxViewWin()->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); |
| 1016 } | 1019 } |
| 1017 #endif | 1020 #endif |
| 1018 | 1021 |
| 1019 void LocationBarView::ShowFirstRunBubbleInternal( | 1022 void LocationBarView::ShowFirstRunBubbleInternal( |
| 1020 FirstRun::BubbleType bubble_type) { | 1023 FirstRun::BubbleType bubble_type) { |
| 1021 #if defined(OS_WIN) // First run bubble doesn't make sense for Chrome OS. | 1024 #if defined(OS_WIN) || !defined(OS_CHROMEOS) |
|
msw
2011/10/20 19:17:50
Ditto, shouldn't this just be: "#if !defined(OS_CH
| |
| 1025 // First run bubble doesn't make sense for Chrome OS. | |
| 1022 // Point at the start of the edit control; adjust to look as good as possible. | 1026 // Point at the start of the edit control; adjust to look as good as possible. |
| 1023 const int kXOffset = kNormalHorizontalEdgeThickness + kEdgeItemPadding + | 1027 const int kXOffset = kNormalHorizontalEdgeThickness + kEdgeItemPadding + |
| 1024 ResourceBundle::GetSharedInstance().GetBitmapNamed( | 1028 ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 1025 IDR_OMNIBOX_HTTP)->width() + kItemPadding; | 1029 IDR_OMNIBOX_HTTP)->width() + kItemPadding; |
| 1026 const int kYOffset = -(kVerticalEdgeThickness + 2); | 1030 const int kYOffset = -(kVerticalEdgeThickness + 2); |
| 1027 gfx::Point origin(location_entry_view_->bounds().x() + kXOffset, | 1031 gfx::Point origin(location_entry_view_->bounds().x() + kXOffset, |
| 1028 y() + height() + kYOffset); | 1032 y() + height() + kYOffset); |
| 1029 // If the UI layout is RTL, the coordinate system is not transformed and | 1033 // If the UI layout is RTL, the coordinate system is not transformed and |
| 1030 // therefore we need to adjust the X coordinate so that bubble appears on the | 1034 // therefore we need to adjust the X coordinate so that bubble appears on the |
| 1031 // right hand side of the location bar. | 1035 // right hand side of the location bar. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1272 !suggested_text_view_->GetText().empty(); | 1276 !suggested_text_view_->GetText().empty(); |
| 1273 } | 1277 } |
| 1274 | 1278 |
| 1275 #if !defined(USE_AURA) | 1279 #if !defined(USE_AURA) |
| 1276 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1280 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
| 1277 CHECK(!views::Widget::IsPureViews()); | 1281 CHECK(!views::Widget::IsPureViews()); |
| 1278 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1282 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
| 1279 } | 1283 } |
| 1280 #endif | 1284 #endif |
| 1281 #endif | 1285 #endif |
| OLD | NEW |