OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/instant/instant_controller.h" | 5 #include "chrome/browser/instant/instant_controller.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 NotificationService::current()->Notify( | 182 NotificationService::current()->Notify( |
183 NotificationType::INSTANT_CONTROLLER_UPDATED, | 183 NotificationType::INSTANT_CONTROLLER_UPDATED, |
184 Source<InstantController>(this), | 184 Source<InstantController>(this), |
185 NotificationService::NoDetails()); | 185 NotificationService::NoDetails()); |
186 } | 186 } |
187 | 187 |
188 void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) { | 188 void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) { |
189 if (omnibox_bounds_ == bounds) | 189 if (omnibox_bounds_ == bounds) |
190 return; | 190 return; |
191 | 191 |
| 192 // Always track the omnibox bounds. That way if Update is later invoked the |
| 193 // bounds are in sync. |
| 194 omnibox_bounds_ = bounds; |
192 if (loader_manager_.get()) { | 195 if (loader_manager_.get()) { |
193 omnibox_bounds_ = bounds; | |
194 if (loader_manager_->current_loader()) | 196 if (loader_manager_->current_loader()) |
195 loader_manager_->current_loader()->SetOmniboxBounds(bounds); | 197 loader_manager_->current_loader()->SetOmniboxBounds(bounds); |
196 if (loader_manager_->pending_loader()) | 198 if (loader_manager_->pending_loader()) |
197 loader_manager_->pending_loader()->SetOmniboxBounds(bounds); | 199 loader_manager_->pending_loader()->SetOmniboxBounds(bounds); |
198 } | 200 } |
199 } | 201 } |
200 | 202 |
201 void InstantController::DestroyPreviewContents() { | 203 void InstantController::DestroyPreviewContents() { |
202 if (!loader_manager_.get()) { | 204 if (!loader_manager_.get()) { |
203 // We're not showing anything, nothing to do. | 205 // We're not showing anything, nothing to do. |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 return "Predictive"; | 606 return "Predictive"; |
605 case VERBATIM_TYPE: | 607 case VERBATIM_TYPE: |
606 return "Verbatim"; | 608 return "Verbatim"; |
607 case PREDICTIVE_NO_AUTO_COMPLETE_TYPE: | 609 case PREDICTIVE_NO_AUTO_COMPLETE_TYPE: |
608 return "PredictiveNoAutoComplete"; | 610 return "PredictiveNoAutoComplete"; |
609 default: | 611 default: |
610 NOTREACHED(); | 612 NOTREACHED(); |
611 return std::string(); | 613 return std::string(); |
612 } | 614 } |
613 } | 615 } |
OLD | NEW |