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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 if (contents) { | 315 if (contents) { |
316 RevertAll(); | 316 RevertAll(); |
317 const AutocompleteEditState* state = | 317 const AutocompleteEditState* state = |
318 GetStateAccessor()->GetProperty(contents->property_bag()); | 318 GetStateAccessor()->GetProperty(contents->property_bag()); |
319 if (state) { | 319 if (state) { |
320 model_->RestoreState(state->model_state); | 320 model_->RestoreState(state->model_state); |
321 | 321 |
322 // Move the marks for the cursor and the other end of the selection to | 322 // Move the marks for the cursor and the other end of the selection to |
323 // the previously-saved offsets (but preserve PRIMARY). | 323 // the previously-saved offsets (but preserve PRIMARY). |
324 textfield_->SelectRange(state->view_state.selection_range); | 324 textfield_->SelectRange(state->view_state.selection_range); |
325 textfield_->ClearEditHistory(); | |
msw
2011/06/02 10:16:42
perhaps comment on why we're doing this. (I'm not
oshima
2011/06/02 19:11:42
Done. Added TODO for future improvement.
| |
325 } | 326 } |
326 } else if (visibly_changed_permanent_text) { | 327 } else if (visibly_changed_permanent_text) { |
327 RevertAll(); | 328 RevertAll(); |
328 } else if (changed_security_level) { | 329 } else if (changed_security_level) { |
329 EmphasizeURLComponents(); | 330 EmphasizeURLComponents(); |
330 } | 331 } |
331 } | 332 } |
332 | 333 |
333 void OmniboxViewViews::OpenMatch(const AutocompleteMatch& match, | 334 void OmniboxViewViews::OpenMatch(const AutocompleteMatch& match, |
334 WindowOpenDisposition disposition, | 335 WindowOpenDisposition disposition, |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 normal_text_style_ = textfield_->CreateTextStyle(); | 696 normal_text_style_ = textfield_->CreateTextStyle(); |
696 security_error_scheme_style_ = textfield_->CreateTextStyle(); | 697 security_error_scheme_style_ = textfield_->CreateTextStyle(); |
697 secure_scheme_style_ = textfield_->CreateTextStyle(); | 698 secure_scheme_style_ = textfield_->CreateTextStyle(); |
698 | 699 |
699 faded_text_style_->set_foreground(kFadedTextColor); | 700 faded_text_style_->set_foreground(kFadedTextColor); |
700 normal_text_style_->set_foreground(kNormalTextColor); | 701 normal_text_style_->set_foreground(kNormalTextColor); |
701 secure_scheme_style_->set_foreground(kSecureSchemeColor); | 702 secure_scheme_style_->set_foreground(kSecureSchemeColor); |
702 security_error_scheme_style_->set_foreground(kSecurityErrorSchemeColor); | 703 security_error_scheme_style_->set_foreground(kSecurityErrorSchemeColor); |
703 security_error_scheme_style_->set_strike(true); | 704 security_error_scheme_style_->set_strike(true); |
704 } | 705 } |
OLD | NEW |