| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // Explicitly teardown members which have a reference to us. Just to be safe | 156 // Explicitly teardown members which have a reference to us. Just to be safe |
| 157 // we want them to be destroyed before destroying any other internal state. | 157 // we want them to be destroyed before destroying any other internal state. |
| 158 popup_view_.reset(); | 158 popup_view_.reset(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
| 162 // OmniboxViewViews public: | 162 // OmniboxViewViews public: |
| 163 | 163 |
| 164 void OmniboxViewViews::Init() { | 164 void OmniboxViewViews::Init() { |
| 165 SetController(this); | 165 set_controller(this); |
| 166 SetTextInputType(DetermineTextInputType()); | 166 SetTextInputType(DetermineTextInputType()); |
| 167 SetBackgroundColor(location_bar_view_->GetColor( | 167 SetBackgroundColor(location_bar_view_->GetColor( |
| 168 ToolbarModel::NONE, LocationBarView::BACKGROUND)); | 168 ToolbarModel::NONE, LocationBarView::BACKGROUND)); |
| 169 | 169 |
| 170 if (popup_window_mode_) | 170 if (popup_window_mode_) |
| 171 SetReadOnly(true); | 171 SetReadOnly(true); |
| 172 | 172 |
| 173 if (chrome::ShouldDisplayOriginChip()) | 173 if (chrome::ShouldDisplayOriginChip()) |
| 174 set_placeholder_text(l10n_util::GetStringUTF16(IDS_OMNIBOX_EMPTY_HINT)); | 174 set_placeholder_text(l10n_util::GetStringUTF16(IDS_OMNIBOX_EMPTY_HINT)); |
| 175 | 175 |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 const base::string16 text(GetClipboardText()); | 976 const base::string16 text(GetClipboardText()); |
| 977 if (!text.empty()) { | 977 if (!text.empty()) { |
| 978 // Record this paste, so we can do different behavior. | 978 // Record this paste, so we can do different behavior. |
| 979 model()->OnPaste(); | 979 model()->OnPaste(); |
| 980 // Force a Paste operation to trigger the text_changed code in | 980 // Force a Paste operation to trigger the text_changed code in |
| 981 // OnAfterPossibleChange(), even if identical contents are pasted. | 981 // OnAfterPossibleChange(), even if identical contents are pasted. |
| 982 text_before_change_.clear(); | 982 text_before_change_.clear(); |
| 983 InsertOrReplaceText(text); | 983 InsertOrReplaceText(text); |
| 984 } | 984 } |
| 985 } | 985 } |
| OLD | NEW |