Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/ui/search/search_tab_helper.h

Issue 17521002: Added a check in Searchbox::OnMostVisitedChanged() to prevent duplicate notifications regarding mos… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_
7 7
8 #include <vector>
9
10 #include "base/basictypes.h" 8 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
13 #include "chrome/browser/ui/search/search_model.h" 11 #include "chrome/browser/ui/search/search_model.h"
14 #include "chrome/common/instant_types.h"
15 #include "content/public/browser/notification_observer.h" 12 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h" 13 #include "content/public/browser/notification_registrar.h"
17 #include "content/public/browser/web_contents_observer.h" 14 #include "content/public/browser/web_contents_observer.h"
18 #include "content/public/browser/web_contents_user_data.h" 15 #include "content/public/browser/web_contents_user_data.h"
19 16
20 namespace content { 17 namespace content {
21 class WebContents; 18 class WebContents;
22 } 19 }
23 20
24 class InstantPageTest; 21 class InstantPageTest;
(...skipping 21 matching lines...) Expand all
46 bool cancelling, 43 bool cancelling,
47 bool popup_is_open, 44 bool popup_is_open,
48 bool user_text_is_empty); 45 bool user_text_is_empty);
49 46
50 // Invoked when the active navigation entry is updated in some way that might 47 // Invoked when the active navigation entry is updated in some way that might
51 // affect the search mode. This is used by Instant when it "fixes up" the 48 // affect the search mode. This is used by Instant when it "fixes up" the
52 // virtual URL of the active entry. Regular navigations are captured through 49 // virtual URL of the active entry. Regular navigations are captured through
53 // the notification system and shouldn't call this method. 50 // the notification system and shouldn't call this method.
54 void NavigationEntryUpdated(); 51 void NavigationEntryUpdated();
55 52
56 // Updates |last_known_most_visited_items_| with |items|.
57 // Returns false if |items| matches the |last_known_most_visited_items_|.
58 bool UpdateLastKnownMostVisitedItems(
59 const std::vector<InstantMostVisitedItem>& items);
60
61 // Invoked to update the instant support state. 53 // Invoked to update the instant support state.
62 void InstantSupportChanged(bool supports_instant); 54 void InstantSupportChanged(bool supports_instant);
63 55
64 // Returns true if the page supports instant. If the instant support state is 56 // Returns true if the page supports instant. If the instant support state is
65 // not determined or if the page does not support instant returns false. 57 // not determined or if the page does not support instant returns false.
66 bool SupportsInstant() const; 58 bool SupportsInstant() const;
67 59
68 private: 60 private:
69 friend class content::WebContentsUserData<SearchTabHelper>; 61 friend class content::WebContentsUserData<SearchTabHelper>;
70 friend class InstantPageTest; 62 friend class InstantPageTest;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 bool popup_is_open_; 111 bool popup_is_open_;
120 bool user_text_is_empty_; 112 bool user_text_is_empty_;
121 113
122 // Model object for UI that cares about search state. 114 // Model object for UI that cares about search state.
123 SearchModel model_; 115 SearchModel model_;
124 116
125 content::NotificationRegistrar registrar_; 117 content::NotificationRegistrar registrar_;
126 118
127 content::WebContents* web_contents_; 119 content::WebContents* web_contents_;
128 120
129 // Tracks the last set of most visited items sent to the InstantPage renderer.
130 // Used to prevent sending duplicate IPC messages to the renderer.
131 std::vector<InstantMostVisitedItem> last_known_most_visited_items_;
132
133 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); 121 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper);
134 }; 122 };
135 123
136 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ 124 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698