| 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/property_bag.h" | 8 #include "base/property_bag.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 gfx::SelectionModel selection; | 482 gfx::SelectionModel selection; |
| 483 textfield_->GetSelectionModel(&selection); | 483 textfield_->GetSelectionModel(&selection); |
| 484 GetStateAccessor()->SetProperty( | 484 GetStateAccessor()->SetProperty( |
| 485 tab->GetPropertyBag(), | 485 tab->GetPropertyBag(), |
| 486 AutocompleteEditState(model_state, ViewState(selection))); | 486 AutocompleteEditState(model_state, ViewState(selection))); |
| 487 } | 487 } |
| 488 | 488 |
| 489 void OmniboxViewViews::Update(const WebContents* contents) { | 489 void OmniboxViewViews::Update(const WebContents* contents) { |
| 490 // NOTE: We're getting the URL text here from the ToolbarModel. | 490 // NOTE: We're getting the URL text here from the ToolbarModel. |
| 491 bool visibly_changed_permanent_text = | 491 bool visibly_changed_permanent_text = |
| 492 model()->UpdatePermanentText(toolbar_model()->GetText()); | 492 model()->UpdatePermanentText(toolbar_model()->GetText(true)); |
| 493 ToolbarModel::SecurityLevel security_level = | 493 ToolbarModel::SecurityLevel security_level = |
| 494 toolbar_model()->GetSecurityLevel(); | 494 toolbar_model()->GetSecurityLevel(); |
| 495 bool changed_security_level = (security_level != security_level_); | 495 bool changed_security_level = (security_level != security_level_); |
| 496 security_level_ = security_level; | 496 security_level_ = security_level; |
| 497 | 497 |
| 498 // TODO(oshima): Copied from gtk implementation which is | 498 // TODO(oshima): Copied from gtk implementation which is |
| 499 // slightly different from WIN impl. Find out the correct implementation | 499 // slightly different from WIN impl. Find out the correct implementation |
| 500 // for views-implementation. | 500 // for views-implementation. |
| 501 if (contents) { | 501 if (contents) { |
| 502 RevertAll(); | 502 RevertAll(); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 const ui::Range& range) { | 899 const ui::Range& range) { |
| 900 if (text != GetText()) | 900 if (text != GetText()) |
| 901 textfield_->SetText(text); | 901 textfield_->SetText(text); |
| 902 textfield_->SelectRange(range); | 902 textfield_->SelectRange(range); |
| 903 } | 903 } |
| 904 | 904 |
| 905 string16 OmniboxViewViews::GetSelectedText() const { | 905 string16 OmniboxViewViews::GetSelectedText() const { |
| 906 // TODO(oshima): Support instant, IME. | 906 // TODO(oshima): Support instant, IME. |
| 907 return textfield_->GetSelectedText(); | 907 return textfield_->GetSelectedText(); |
| 908 } | 908 } |
| OLD | NEW |