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/renderer/searchbox/searchbox.h" | 5 #include "chrome/renderer/searchbox/searchbox.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/favicon/favicon_url_parser.h" | 13 #include "chrome/common/favicon/favicon_url_parser.h" |
14 #include "chrome/common/omnibox_focus_state.h" | 14 #include "chrome/common/omnibox_focus_state.h" |
15 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "chrome/renderer/searchbox/searchbox_extension.h" | 17 #include "chrome/renderer/searchbox/searchbox_extension.h" |
18 #include "components/favicon_base/favicon_types.h" | 18 #include "components/favicon_base/favicon_types.h" |
19 #include "content/public/renderer/render_view.h" | 19 #include "content/public/renderer/render_view.h" |
20 #include "grit/renderer_resources.h" | |
21 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
22 #include "third_party/WebKit/public/web/WebDocument.h" | 21 #include "third_party/WebKit/public/web/WebDocument.h" |
23 #include "third_party/WebKit/public/web/WebFrame.h" | 22 #include "third_party/WebKit/public/web/WebFrame.h" |
24 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
25 #include "ui/base/resource/resource_bundle.h" | |
26 #include "url/gurl.h" | 24 #include "url/gurl.h" |
27 | 25 |
28 namespace { | 26 namespace { |
29 | 27 |
30 // The size of the InstantMostVisitedItem cache. | 28 // The size of the InstantMostVisitedItem cache. |
31 const size_t kMaxInstantMostVisitedItemCacheSize = 100; | 29 const size_t kMaxInstantMostVisitedItemCacheSize = 100; |
32 | 30 |
33 // Returns true if items stored in |old_item_id_pairs| and |new_items| are | 31 // Returns true if items stored in |old_item_id_pairs| and |new_items| are |
34 // equal. | 32 // equal. |
35 bool AreMostVisitedItemsEqual( | 33 bool AreMostVisitedItemsEqual( |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 462 } |
465 | 463 |
466 void SearchBox::Reset() { | 464 void SearchBox::Reset() { |
467 query_.clear(); | 465 query_.clear(); |
468 suggestion_ = InstantSuggestion(); | 466 suggestion_ = InstantSuggestion(); |
469 start_margin_ = 0; | 467 start_margin_ = 0; |
470 is_focused_ = false; | 468 is_focused_ = false; |
471 is_key_capture_enabled_ = false; | 469 is_key_capture_enabled_ = false; |
472 theme_info_ = ThemeBackgroundInfo(); | 470 theme_info_ = ThemeBackgroundInfo(); |
473 } | 471 } |
OLD | NEW |