| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/instant/instant_controller.h" | 5 #include "chrome/browser/instant/instant_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.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" |
| 11 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 11 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 12 #include "chrome/browser/google/google_util.h" | 12 #include "chrome/browser/google/google_util.h" |
| 13 #include "chrome/browser/history/history.h" | 13 #include "chrome/browser/history/history.h" |
| 14 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
| 15 #include "chrome/browser/history/history_tab_helper.h" | 15 #include "chrome/browser/history/history_tab_helper.h" |
| 16 #include "chrome/browser/instant/instant_loader.h" | 16 #include "chrome/browser/instant/instant_loader.h" |
| 17 #include "chrome/browser/instant/instant_tab.h" | 17 #include "chrome/browser/instant/instant_tab.h" |
| 18 #include "chrome/browser/platform_util.h" | 18 #include "chrome/browser/platform_util.h" |
| 19 #include "chrome/browser/search_engines/template_url_service.h" | 19 #include "chrome/browser/search_engines/template_url_service.h" |
| 20 #include "chrome/browser/search_engines/template_url_service_factory.h" | 20 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 21 #include "chrome/browser/ui/browser_instant_controller.h" | 21 #include "chrome/browser/ui/browser_instant_controller.h" |
| 22 #include "chrome/browser/ui/search/search_tab_helper.h" | 22 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "content/public/browser/navigation_entry.h" | 25 #include "content/public/browser/navigation_entry.h" |
| 26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 27 #include "content/public/browser/render_widget_host_view.h" | 27 #include "content/public/browser/render_widget_host_view.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "net/base/escape.h" | 29 #include "net/base/escape.h" |
| 30 #include "unicode/normalizer2.h" | 30 #include "third_party/icu/public/common/unicode/normalizer2.h" |
| 31 | 31 |
| 32 #if defined(TOOLKIT_VIEWS) | 32 #if defined(TOOLKIT_VIEWS) |
| 33 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // An artificial delay (in milliseconds) we introduce before telling the Instant | 38 // An artificial delay (in milliseconds) we introduce before telling the Instant |
| 39 // page about the new omnibox bounds, in cases where the bounds shrink. This is | 39 // page about the new omnibox bounds, in cases where the bounds shrink. This is |
| 40 // to avoid the page jumping up/down very fast in response to bounds changes. | 40 // to avoid the page jumping up/down very fast in response to bounds changes. |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 std::map<std::string, int>::const_iterator iter = | 1201 std::map<std::string, int>::const_iterator iter = |
| 1202 blacklisted_urls_.find(*instant_url); | 1202 blacklisted_urls_.find(*instant_url); |
| 1203 if (iter != blacklisted_urls_.end() && | 1203 if (iter != blacklisted_urls_.end() && |
| 1204 iter->second > kMaxInstantSupportFailures) | 1204 iter->second > kMaxInstantSupportFailures) |
| 1205 return false; | 1205 return false; |
| 1206 | 1206 |
| 1207 return true; | 1207 return true; |
| 1208 } | 1208 } |
| OLD | NEW |