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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // TODO(oshima): we don't have native view. This requires | 286 // TODO(oshima): we don't have native view. This requires |
287 // further refactoring. | 287 // further refactoring. |
288 model_->OnWillKillFocus(NULL); | 288 model_->OnWillKillFocus(NULL); |
289 // Close the popup. | 289 // Close the popup. |
290 ClosePopup(); | 290 ClosePopup(); |
291 // Tell the model to reset itself. | 291 // Tell the model to reset itself. |
292 model_->OnKillFocus(); | 292 model_->OnKillFocus(); |
293 controller_->OnKillFocus(); | 293 controller_->OnKillFocus(); |
294 } | 294 } |
295 | 295 |
| 296 void OmniboxViewViews::SetLocationEntryFocusable(bool focusable) { |
| 297 textfield_->set_focusable(focusable); |
| 298 } |
| 299 |
| 300 bool OmniboxViewViews::IsLocationEntryFocusableInRootView() const { |
| 301 return textfield_->IsFocusableInRootView(); |
| 302 } |
| 303 |
296 //////////////////////////////////////////////////////////////////////////////// | 304 //////////////////////////////////////////////////////////////////////////////// |
297 // OmniboxViewViews, views::View implementation: | 305 // OmniboxViewViews, views::View implementation: |
298 void OmniboxViewViews::Layout() { | 306 void OmniboxViewViews::Layout() { |
299 gfx::Insets insets = GetInsets(); | 307 gfx::Insets insets = GetInsets(); |
300 textfield_->SetBounds(insets.left(), insets.top(), | 308 textfield_->SetBounds(insets.left(), insets.top(), |
301 width() - insets.width(), | 309 width() - insets.width(), |
302 height() - insets.height()); | 310 height() - insets.height()); |
303 } | 311 } |
304 | 312 |
305 void OmniboxViewViews::GetAccessibleState(ui::AccessibleViewState* state) { | 313 void OmniboxViewViews::GetAccessibleState(ui::AccessibleViewState* state) { |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, | 749 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, |
742 toolbar_model, | 750 toolbar_model, |
743 profile, | 751 profile, |
744 command_updater, | 752 command_updater, |
745 popup_window_mode, | 753 popup_window_mode, |
746 location_bar); | 754 location_bar); |
747 omnibox_view->Init(); | 755 omnibox_view->Init(); |
748 return omnibox_view; | 756 return omnibox_view; |
749 } | 757 } |
750 #endif | 758 #endif |
OLD | NEW |