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 #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> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/ui/search/search_model.h" | 13 #include "chrome/browser/ui/search/search_model.h" |
13 #include "chrome/common/instant_types.h" | 14 #include "chrome/common/instant_types.h" |
14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
17 #include "content/public/browser/web_contents_user_data.h" | 18 #include "content/public/browser/web_contents_user_data.h" |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class WebContents; | 21 class WebContents; |
21 } | 22 } |
(...skipping 21 matching lines...) Expand all Loading... | |
43 // affect the search mode. This is used by Instant when it "fixes up" the | 44 // affect the search mode. This is used by Instant when it "fixes up" the |
44 // virtual URL of the active entry. Regular navigations are captured through | 45 // virtual URL of the active entry. Regular navigations are captured through |
45 // the notification system and shouldn't call this method. | 46 // the notification system and shouldn't call this method. |
46 void NavigationEntryUpdated(); | 47 void NavigationEntryUpdated(); |
47 | 48 |
48 // Updates |last_known_most_visited_items_| with |items|. | 49 // Updates |last_known_most_visited_items_| with |items|. |
49 // Returns false if |items| matches the |last_known_most_visited_items_|. | 50 // Returns false if |items| matches the |last_known_most_visited_items_|. |
50 bool UpdateLastKnownMostVisitedItems( | 51 bool UpdateLastKnownMostVisitedItems( |
51 const std::vector<InstantMostVisitedItem>& items); | 52 const std::vector<InstantMostVisitedItem>& items); |
52 | 53 |
54 // Updates |last_known_theme_info_| with |theme_info|. | |
55 // Returns false if |theme_info| matches the |last_known_theme_info_|. | |
56 bool UpdateLastKnownThemeBackgroundInfo( | |
57 const ThemeBackgroundInfo& theme_info); | |
58 | |
53 private: | 59 private: |
54 friend class content::WebContentsUserData<SearchTabHelper>; | 60 friend class content::WebContentsUserData<SearchTabHelper>; |
55 | 61 |
56 explicit SearchTabHelper(content::WebContents* web_contents); | 62 explicit SearchTabHelper(content::WebContents* web_contents); |
57 | 63 |
58 // Overridden from content::NotificationObserver: | 64 // Overridden from content::NotificationObserver: |
59 virtual void Observe(int type, | 65 virtual void Observe(int type, |
60 const content::NotificationSource& source, | 66 const content::NotificationSource& source, |
61 const content::NotificationDetails& details) OVERRIDE; | 67 const content::NotificationDetails& details) OVERRIDE; |
62 | 68 |
(...skipping 19 matching lines...) Expand all Loading... | |
82 SearchModel model_; | 88 SearchModel model_; |
83 | 89 |
84 content::NotificationRegistrar registrar_; | 90 content::NotificationRegistrar registrar_; |
85 | 91 |
86 content::WebContents* web_contents_; | 92 content::WebContents* web_contents_; |
87 | 93 |
88 // Tracks the last set of most visited items sent to the InstantPage renderer. | 94 // Tracks the last set of most visited items sent to the InstantPage renderer. |
89 // Used to prevent sending duplicate IPC messages to the renderer. | 95 // Used to prevent sending duplicate IPC messages to the renderer. |
90 std::vector<InstantMostVisitedItem> last_known_most_visited_items_; | 96 std::vector<InstantMostVisitedItem> last_known_most_visited_items_; |
91 | 97 |
98 // Tracks the last known theme background details. | |
99 scoped_ptr<ThemeBackgroundInfo> last_known_theme_info_; | |
samarth
2013/06/19 18:30:02
As discussed offline, let's track this in the rend
kmadhusu
2013/06/19 21:31:01
Done.
| |
100 | |
92 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 101 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
93 }; | 102 }; |
94 | 103 |
95 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 104 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |