OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } | 413 } |
414 | 414 |
415 void OmniboxViewViews::SetLocationEntryFocusable(bool focusable) { | 415 void OmniboxViewViews::SetLocationEntryFocusable(bool focusable) { |
416 textfield_->set_focusable(focusable); | 416 textfield_->set_focusable(focusable); |
417 } | 417 } |
418 | 418 |
419 bool OmniboxViewViews::IsLocationEntryFocusableInRootView() const { | 419 bool OmniboxViewViews::IsLocationEntryFocusableInRootView() const { |
420 return textfield_->IsFocusable(); | 420 return textfield_->IsFocusable(); |
421 } | 421 } |
422 | 422 |
423 void OmniboxViewViews::ExecuteCommandOnTextField(int command_id) { | |
424 return textfield_->ExecuteCommand(command_id); | |
425 } | |
426 | |
427 //////////////////////////////////////////////////////////////////////////////// | 423 //////////////////////////////////////////////////////////////////////////////// |
428 // OmniboxViewViews, views::View implementation: | 424 // OmniboxViewViews, views::View implementation: |
429 void OmniboxViewViews::Layout() { | 425 void OmniboxViewViews::Layout() { |
430 gfx::Insets insets = GetInsets(); | 426 gfx::Insets insets = GetInsets(); |
431 textfield_->SetBounds(insets.left(), insets.top(), | 427 textfield_->SetBounds(insets.left(), insets.top(), |
432 width() - insets.width(), | 428 width() - insets.width(), |
433 height() - insets.height()); | 429 height() - insets.height()); |
434 } | 430 } |
435 | 431 |
436 void OmniboxViewViews::GetAccessibleState(ui::AccessibleViewState* state) { | 432 void OmniboxViewViews::GetAccessibleState(ui::AccessibleViewState* state) { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 if (!text.empty()) { | 963 if (!text.empty()) { |
968 // Record this paste, so we can do different behavior. | 964 // Record this paste, so we can do different behavior. |
969 model()->on_paste(); | 965 model()->on_paste(); |
970 // Force a Paste operation to trigger the text_changed code in | 966 // Force a Paste operation to trigger the text_changed code in |
971 // OnAfterPossibleChange(), even if identical contents are pasted into the | 967 // OnAfterPossibleChange(), even if identical contents are pasted into the |
972 // text box. | 968 // text box. |
973 text_before_change_.clear(); | 969 text_before_change_.clear(); |
974 textfield_->ReplaceSelection(text); | 970 textfield_->ReplaceSelection(text); |
975 } | 971 } |
976 } | 972 } |
OLD | NEW |