OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/search/search_model.h" | 10 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const GURL& url, | 46 const GURL& url, |
47 content::NavigationController::ReloadType reload_type) OVERRIDE; | 47 content::NavigationController::ReloadType reload_type) OVERRIDE; |
48 | 48 |
49 // Overridden from content::NotificationObserver: | 49 // Overridden from content::NotificationObserver: |
50 virtual void Observe(int type, | 50 virtual void Observe(int type, |
51 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
52 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
53 | 53 |
54 private: | 54 private: |
55 // Sets the mode of the model based on |url|. | 55 // Sets the mode of the model based on |url|. |
56 void UpdateModel(const GURL& url); | 56 // |animate| is flag in model's mode. |
| 57 void UpdateModel(const GURL& url, bool animate); |
57 | 58 |
58 // On navigation away from NTP and Search pages, delete |ntp_web_contents_|. | 59 // On navigation away from NTP and Search pages, delete |ntp_web_contents_|. |
59 void FlushNTP(const GURL& url); | 60 void FlushNTP(const GURL& url); |
60 | 61 |
61 const bool is_search_enabled_; | 62 const bool is_search_enabled_; |
62 | 63 |
63 // Model object for UI that cares about search state. | 64 // Model object for UI that cares about search state. |
64 SearchModel model_; | 65 SearchModel model_; |
65 | 66 |
66 // Lazily created web contents for NTP. | 67 // Lazily created web contents for NTP. |
67 scoped_ptr<content::WebContents> ntp_web_contents_; | 68 scoped_ptr<content::WebContents> ntp_web_contents_; |
68 | 69 |
69 content::NotificationRegistrar registrar_; | 70 content::NotificationRegistrar registrar_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 72 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace search | 75 } // namespace search |
75 } // namespace chrome | 76 } // namespace chrome |
76 | 77 |
77 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 78 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |