| OLD | NEW |
| 1 // Copyright (c) 2010 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "app/drag_drop_types.h" | 11 #include "app/drag_drop_types.h" |
| 12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
| 13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
| 14 #include "app/theme_provider.h" | 14 #include "app/theme_provider.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 42 #include "gfx/canvas_skia.h" | 42 #include "gfx/canvas_skia.h" |
| 43 #include "gfx/color_utils.h" | 43 #include "gfx/color_utils.h" |
| 44 #include "gfx/skia_util.h" | 44 #include "gfx/skia_util.h" |
| 45 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 46 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
| 47 #include "views/controls/label.h" | 47 #include "views/controls/label.h" |
| 48 #include "views/drag_utils.h" | 48 #include "views/drag_utils.h" |
| 49 | 49 |
| 50 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 51 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" | 51 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" |
| 52 #include "chrome/browser/views/first_run_bubble.h" | 52 #include "chrome/browser/ui/views/first_run_bubble.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 using views::View; | 55 using views::View; |
| 56 | 56 |
| 57 namespace { | 57 namespace { |
| 58 TabContents* GetTabContentsFromDelegate(LocationBarView::Delegate* delegate) { | 58 TabContents* GetTabContentsFromDelegate(LocationBarView::Delegate* delegate) { |
| 59 const TabContentsWrapper* wrapper = delegate->GetTabContentsWrapper(); | 59 const TabContentsWrapper* wrapper = delegate->GetTabContentsWrapper(); |
| 60 return wrapper ? wrapper->tab_contents() : NULL; | 60 return wrapper ? wrapper->tab_contents() : NULL; |
| 61 } | 61 } |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 // static | 64 // static |
| 65 const int LocationBarView::kNormalHorizontalEdgeThickness = 1; | 65 const int LocationBarView::kNormalHorizontalEdgeThickness = 1; |
| 66 const int LocationBarView::kVerticalEdgeThickness = 2; | 66 const int LocationBarView::kVerticalEdgeThickness = 2; |
| 67 const int LocationBarView::kItemPadding = 3; | 67 const int LocationBarView::kItemPadding = 3; |
| 68 const int LocationBarView::kExtensionItemPadding = 5; | 68 const int LocationBarView::kExtensionItemPadding = 5; |
| 69 const int LocationBarView::kEdgeItemPadding = kItemPadding; | 69 const int LocationBarView::kEdgeItemPadding = kItemPadding; |
| 70 const int LocationBarView::kBubblePadding = 1; | 70 const int LocationBarView::kBubblePadding = 1; |
| 71 const char LocationBarView::kViewClassName[] = | 71 const char LocationBarView::kViewClassName[] = |
| 72 "browser/views/location_bar/LocationBarView"; | 72 "browser/ui/views/location_bar/LocationBarView"; |
| 73 | 73 |
| 74 static const int kEVBubbleBackgroundImages[] = { | 74 static const int kEVBubbleBackgroundImages[] = { |
| 75 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_L, | 75 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_L, |
| 76 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_C, | 76 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_C, |
| 77 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_R, | 77 IDR_OMNIBOX_EV_BUBBLE_BACKGROUND_R, |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 static const int kSelectedKeywordBackgroundImages[] = { | 80 static const int kSelectedKeywordBackgroundImages[] = { |
| 81 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_L, | 81 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_L, |
| 82 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_C, | 82 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_C, |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 template_url_model_ = NULL; | 1260 template_url_model_ = NULL; |
| 1261 ShowFirstRunBubble(bubble_type_); | 1261 ShowFirstRunBubble(bubble_type_); |
| 1262 } | 1262 } |
| 1263 | 1263 |
| 1264 #if defined(OS_WIN) | 1264 #if defined(OS_WIN) |
| 1265 bool LocationBarView::HasValidSuggestText() { | 1265 bool LocationBarView::HasValidSuggestText() { |
| 1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
| 1267 !suggested_text_view_->GetText().empty(); | 1267 !suggested_text_view_->GetText().empty(); |
| 1268 } | 1268 } |
| 1269 #endif | 1269 #endif |
| OLD | NEW |