summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 20:47:53 +0000
committersuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 20:47:53 +0000
commite6d6b43f9aa5b1da627fe7067d36fe47d46abedb (patch)
treeb066da36f24e062329731d3767b32fa4c855d581 /chrome
parent051e4ecafeb6da960517224bdd0348dae7e43784 (diff)
downloadchromium_src-e6d6b43f9aa5b1da627fe7067d36fe47d46abedb.zip
chromium_src-e6d6b43f9aa5b1da627fe7067d36fe47d46abedb.tar.gz
chromium_src-e6d6b43f9aa5b1da627fe7067d36fe47d46abedb.tar.bz2
Replace views::TextRange with ui::Range.
BUG=none TEST=original unittests. Review URL: http://codereview.chromium.org/6695021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_views.cc20
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_views.h8
2 files changed, 14 insertions, 14 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
index 0d1bdc3..e3626b7 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
@@ -77,12 +77,12 @@ class AutocompleteTextfield : public views::Textfield {
// Stores omnibox state for each tab.
struct ViewState {
- explicit ViewState(const views::TextRange& selection_range)
+ explicit ViewState(const ui::Range& selection_range)
: selection_range(selection_range) {
}
// Range of selected text.
- views::TextRange selection_range;
+ ui::Range selection_range;
};
struct AutocompleteEditState {
@@ -295,7 +295,7 @@ void AutocompleteEditViewViews::SaveStateToTab(TabContents* tab) {
// NOTE: GetStateForTabSwitch may affect GetSelection, so order is important.
AutocompleteEditModel::State model_state = model_->GetStateForTabSwitch();
- views::TextRange selection;
+ ui::Range selection;
textfield_->GetSelectedRange(&selection);
GetStateAccessor()->SetProperty(
tab->property_bag(),
@@ -378,7 +378,7 @@ void AutocompleteEditViewViews::SetUserText(const string16& text,
void AutocompleteEditViewViews::SetWindowTextAndCaretPos(
const string16& text,
size_t caret_pos) {
- const views::TextRange range(caret_pos, caret_pos);
+ const ui::Range range(caret_pos, caret_pos);
SetTextAndSelectedRange(text, range);
}
@@ -404,7 +404,7 @@ bool AutocompleteEditViewViews::DeleteAtEndPressed() {
void AutocompleteEditViewViews::GetSelectionBounds(
string16::size_type* start,
string16::size_type* end) {
- views::TextRange range;
+ ui::Range range;
textfield_->GetSelectedRange(&range);
*start = static_cast<size_t>(range.end());
*end = static_cast<size_t>(range.start());
@@ -430,7 +430,7 @@ void AutocompleteEditViewViews::UpdatePopup() {
// Don't inline autocomplete when the caret/selection isn't at the end of
// the text, or in the middle of composition.
- views::TextRange sel;
+ ui::Range sel;
textfield_->GetSelectedRange(&sel);
bool no_inline_autocomplete = sel.GetMax() < GetTextLength();
@@ -463,7 +463,7 @@ bool AutocompleteEditViewViews::OnInlineAutocompleteTextMaybeChanged(
size_t user_text_length) {
if (display_text == GetText())
return false;
- views::TextRange range(display_text.size(), user_text_length);
+ ui::Range range(display_text.size(), user_text_length);
SetTextAndSelectedRange(display_text, range);
TextChanged();
return true;
@@ -489,7 +489,7 @@ bool AutocompleteEditViewViews::OnAfterPossibleChange() {
content_maybe_changed_by_key_press_ = true;
return false;
}
- views::TextRange new_sel;
+ ui::Range new_sel;
textfield_->GetSelectedRange(&new_sel);
size_t length = GetTextLength();
@@ -639,7 +639,7 @@ void AutocompleteEditViewViews::TextChanged() {
void AutocompleteEditViewViews::SetTextAndSelectedRange(
const string16& text,
- const views::TextRange& range) {
+ const ui::Range& range) {
if (text != GetText())
textfield_->SetText(text);
textfield_->SelectRange(range);
@@ -651,7 +651,7 @@ string16 AutocompleteEditViewViews::GetSelectedText() const {
}
void AutocompleteEditViewViews::SelectRange(size_t caret, size_t end) {
- const views::TextRange range(caret, end);
+ const ui::Range range(caret, end);
textfield_->SelectRange(range);
}
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.h b/chrome/browser/autocomplete/autocomplete_edit_view_views.h
index 1dd1316..3c66c8c 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_views.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.h
@@ -14,7 +14,7 @@
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/common/page_transition_types.h"
#include "content/common/notification_observer.h"
-#include "views/controls/textfield/text_range.h"
+#include "ui/base/range/range.h"
#include "views/controls/textfield/textfield_controller.h"
#include "views/view.h"
#include "webkit/glue/window_open_disposition.h"
@@ -145,7 +145,7 @@ class AutocompleteEditViewViews : public views::View,
// Update the field with |text| and set the selection.
void SetTextAndSelectedRange(const string16& text,
- const views::TextRange& range);
+ const ui::Range& range);
// Returns the selected text.
string16 GetSelectedText() const;
@@ -175,11 +175,11 @@ class AutocompleteEditViewViews : public views::View,
// Selection at the point where the user started using the
// arrows to move around in the popup.
- views::TextRange saved_temporary_selection_;
+ ui::Range saved_temporary_selection_;
// Tracking state before and after a possible change.
string16 text_before_change_;
- views::TextRange sel_before_change_;
+ ui::Range sel_before_change_;
// TODO(oshima): following flags are copied from gtk implementation.
// It should be possible to refactor this class to simplify flags and