OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_view.h" | 5 #include "chrome/browser/views/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 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 SetFocusable(true); | 123 SetFocusable(true); |
124 | 124 |
125 if (!kBackground) { | 125 if (!kBackground) { |
126 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); | 126 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); |
127 kBackground = rb.GetBitmapNamed(IDR_LOCATIONBG); | 127 kBackground = rb.GetBitmapNamed(IDR_LOCATIONBG); |
128 kPopupBackground = rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_CENTER); | 128 kPopupBackground = rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_CENTER); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 LocationBarView::~LocationBarView() { | 132 LocationBarView::~LocationBarView() { |
| 133 #if defined(OS_LINUX) |
| 134 // We must release the ref that the NativeViewHost has on the |
| 135 // AutocompleteEditViewGtk, otherwise its internal OwnedWidgetGtk will |
| 136 // complain about its refcount not being 1 as it is destroyed. |
| 137 location_entry_view_->Detach(); |
| 138 #endif |
133 DeletePageActionViews(); | 139 DeletePageActionViews(); |
134 } | 140 } |
135 | 141 |
136 bool LocationBarView::IsInitialized() const { | 142 bool LocationBarView::IsInitialized() const { |
137 return location_entry_view_ != NULL; | 143 return location_entry_view_ != NULL; |
138 } | 144 } |
139 | 145 |
140 void LocationBarView::Init() { | 146 void LocationBarView::Init() { |
141 if (popup_window_mode_) { | 147 if (popup_window_mode_) { |
142 font_ = ResourceBundle::GetSharedInstance().GetFont( | 148 font_ = ResourceBundle::GetSharedInstance().GetFont( |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 } | 1377 } |
1372 | 1378 |
1373 int LocationBarView::PageActionVisibleCount() { | 1379 int LocationBarView::PageActionVisibleCount() { |
1374 int result = 0; | 1380 int result = 0; |
1375 for (size_t i = 0; i < page_action_image_views_.size(); i++) { | 1381 for (size_t i = 0; i < page_action_image_views_.size(); i++) { |
1376 if (page_action_image_views_[i]->IsVisible()) | 1382 if (page_action_image_views_[i]->IsVisible()) |
1377 ++result; | 1383 ++result; |
1378 } | 1384 } |
1379 return result; | 1385 return result; |
1380 } | 1386 } |
OLD | NEW |