| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/location_bar/location_bar_container.h" |
| 6 |
| 7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 8 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 9 #include "ui/gfx/color_utils.h" |
| 10 #include "ui/views/controls/native/native_view_host.h" |
| 11 #include "ui/views/layout/fill_layout.h" |
| 12 #include "ui/views/widget/widget.h" |
| 13 |
| 14 void LocationBarContainer::OnFocus() { |
| 15 // Reenable when convert back to widget. |
| 16 /* |
| 17 // TODO(sky): verify if this is necessary. |
| 18 GetWidget()->NotifyAccessibilityEvent( |
| 19 this, ui::AccessibilityTypes::EVENT_FOCUS, false); |
| 20 */ |
| 21 location_bar_view_->GetLocationEntry()->SetFocus(); |
| 22 } |
| 23 |
| 24 void LocationBarContainer::PlatformInit() { |
| 25 view_parent_ = this; |
| 26 // TODO: this is right way to go about this on windows, but it leads to ugly |
| 27 // coordinate conversions. Need to straighten those out before reeabling. |
| 28 /* |
| 29 views::Widget* widget = new views::Widget(); |
| 30 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
| 31 params.can_activate = false; |
| 32 params.parent_widget = GetWidget(); |
| 33 widget->Init(params); |
| 34 |
| 35 native_view_host_ = new views::NativeViewHost; |
| 36 AddChildView(native_view_host_); |
| 37 native_view_host_->Attach(widget->GetNativeView()); |
| 38 widget->SetContentsView(new views::View); |
| 39 view_parent_ = widget->GetContentsView(); |
| 40 view_parent_->SetLayoutManager(new views::FillLayout); |
| 41 |
| 42 widget->ShowInactive(); // Do not allow this widget to gain focus. |
| 43 */ |
| 44 } |
| 45 |
| 46 // static |
| 47 SkColor LocationBarContainer::GetBackgroundColor() { |
| 48 return color_utils::GetSysSkColor(COLOR_WINDOW); |
| 49 } |
| 50 |
| 51 void LocationBarContainer::StackAtTop() { |
| 52 view_parent_->GetWidget()->StackAtTop(); |
| 53 } |
| OLD | NEW |