Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 119125: Don't update our text from toolbar if the toolbar's text doesn't (Closed)
Patch Set: Addressed Jeremy's typo comment. Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 2ae916556c6a0e3ec77a39166e8d0d1e24b0f447..11c4dc3ed74820b858f7dc10ce46e7c5b04535b7 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -202,8 +202,8 @@ void AutocompleteEditViewMac::Update(
// that the field isn't always updated correctly. Figure out why
// this is. Maybe this method should be refactored into more
// specific cases.
- const std::wstring text = toolbar_model_->GetText();
- const bool user_visible = model_->UpdatePermanentText(text);
+ const bool user_visible =
+ model_->UpdatePermanentText(toolbar_model_->GetText());
if (tab_for_state_restoring) {
RevertAll();
@@ -237,9 +237,13 @@ void AutocompleteEditViewMac::Update(
// we're getting the selection and popup right.
} else {
- // TODO(shess): Figure out how this case is used, to make sure
- // we're getting the selection and popup right.
- UpdateAndStyleText(text);
+ // TODO(shess): This corresponds to _win and _gtk, except those
+ // guard it with a test for whether the security level changed.
+ // But AFAICT, that can only change if the text changed, and that
+ // code compares the toolbar_model_ security level with the local
+ // security level. Dig in and figure out why this isn't a no-op
+ // that should go away.
+ UpdateAndStyleText(GetText());
}
}
@@ -320,6 +324,10 @@ void AutocompleteEditViewMac::RevertAll() {
ClosePopup();
model_->Revert();
+ // TODO(shess): This should be a no-op, the results from GetText()
+ // could only get there via UpdateAndStyleText() in the first place.
+ // Dig into where this code can be called from and see if this line
+ // can be removed.
UpdateAndStyleText(GetText());
controller_->OnChanged();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698