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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 bool OmniboxViewViews::IsSelectAll() { | 421 bool OmniboxViewViews::IsSelectAll() { |
422 // TODO(oshima): IME support. | 422 // TODO(oshima): IME support. |
423 return textfield_->text() == textfield_->GetSelectedText(); | 423 return textfield_->text() == textfield_->GetSelectedText(); |
424 } | 424 } |
425 | 425 |
426 bool OmniboxViewViews::DeleteAtEndPressed() { | 426 bool OmniboxViewViews::DeleteAtEndPressed() { |
427 return delete_at_end_pressed_; | 427 return delete_at_end_pressed_; |
428 } | 428 } |
429 | 429 |
430 void OmniboxViewViews::GetSelectionBounds(string16::size_type* start, | 430 void OmniboxViewViews::GetSelectionBounds(string16::size_type* start, |
431 string16::size_type* end) { | 431 string16::size_type* end) const { |
432 ui::Range range; | 432 ui::Range range; |
433 textfield_->GetSelectedRange(&range); | 433 textfield_->GetSelectedRange(&range); |
434 *start = static_cast<size_t>(range.end()); | 434 *start = static_cast<size_t>(range.end()); |
435 *end = static_cast<size_t>(range.start()); | 435 *end = static_cast<size_t>(range.start()); |
436 } | 436 } |
437 | 437 |
438 void OmniboxViewViews::SelectAll(bool reversed) { | 438 void OmniboxViewViews::SelectAll(bool reversed) { |
439 if (reversed) | 439 if (reversed) |
440 textfield_->SelectRange(ui::Range(GetTextLength(), 0)); | 440 textfield_->SelectRange(ui::Range(GetTextLength(), 0)); |
441 else | 441 else |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 AutocompletePopupView* OmniboxViewViews::CreatePopupView( | 707 AutocompletePopupView* OmniboxViewViews::CreatePopupView( |
708 View* location_bar) { | 708 View* location_bar) { |
709 #if defined(TOUCH_UI) | 709 #if defined(TOUCH_UI) |
710 typedef TouchAutocompletePopupContentsView AutocompleteContentsView; | 710 typedef TouchAutocompletePopupContentsView AutocompleteContentsView; |
711 #else | 711 #else |
712 typedef AutocompletePopupContentsView AutocompleteContentsView; | 712 typedef AutocompletePopupContentsView AutocompleteContentsView; |
713 #endif | 713 #endif |
714 return new AutocompleteContentsView(gfx::Font(), this, model_.get(), | 714 return new AutocompleteContentsView(gfx::Font(), this, model_.get(), |
715 location_bar); | 715 location_bar); |
716 } | 716 } |
OLD | NEW |