| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 10 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 10 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 11 #include "chrome/common/search_provider.h" | 11 #include "chrome/common/search_provider.h" |
| 12 #include "content/browser/tab_contents/tab_contents_observer.h" | 12 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 13 | 13 |
| 14 class SearchEngineTabHelperDelegate; | 14 class SearchEngineTabHelperDelegate; |
| 15 | 15 |
| 16 // Per-tab search engine manager. Handles dealing search engine processing | 16 // Per-tab search engine manager. Handles dealing search engine processing |
| 17 // functionality. | 17 // functionality. |
| 18 class SearchEngineTabHelper : public TabContentsObserver { | 18 class SearchEngineTabHelper : public TabContentsObserver { |
| 19 public: | 19 public: |
| 20 explicit SearchEngineTabHelper(TabContents* tab_contents); | 20 explicit SearchEngineTabHelper(TabContents* tab_contents); |
| 21 virtual ~SearchEngineTabHelper(); | 21 virtual ~SearchEngineTabHelper(); |
| 22 | 22 |
| 23 SearchEngineTabHelperDelegate* delegate() const { return delegate_; } | 23 SearchEngineTabHelperDelegate* delegate() const { return delegate_; } |
| 24 void set_delegate(SearchEngineTabHelperDelegate* d) { delegate_ = d; } | 24 void set_delegate(SearchEngineTabHelperDelegate* d) { delegate_ = d; } |
| 25 | 25 |
| 26 // TabContentsObserver overrides. | 26 // TabContentsObserver overrides. |
| 27 virtual void DidNavigateMainFrame( | 27 virtual void DidNavigateMainFrame( |
| 28 const content::LoadCommittedDetails& details, | 28 const content::LoadCommittedDetails& details, |
| 29 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; | 29 const content::FrameNavigateParams& params) OVERRIDE; |
| 30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Handles when a page specifies an OSDD (OpenSearch Description Document). | 33 // Handles when a page specifies an OSDD (OpenSearch Description Document). |
| 34 void OnPageHasOSDD(int32 page_id, | 34 void OnPageHasOSDD(int32 page_id, |
| 35 const GURL& doc_url, | 35 const GURL& doc_url, |
| 36 const search_provider::OSDDType& msg_provider_type); | 36 const search_provider::OSDDType& msg_provider_type); |
| 37 | 37 |
| 38 // If params has a searchable form, this tries to create a new keyword. | 38 // If params has a searchable form, this tries to create a new keyword. |
| 39 void GenerateKeywordIfNecessary( | 39 void GenerateKeywordIfNecessary( |
| 40 const ViewHostMsg_FrameNavigate_Params& params); | 40 const content::FrameNavigateParams& params); |
| 41 | 41 |
| 42 // Delegate for notifying our owner about stuff. Not owned by us. | 42 // Delegate for notifying our owner about stuff. Not owned by us. |
| 43 SearchEngineTabHelperDelegate* delegate_; | 43 SearchEngineTabHelperDelegate* delegate_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(SearchEngineTabHelper); | 45 DISALLOW_COPY_AND_ASSIGN(SearchEngineTabHelper); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ | 48 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_ |
| OLD | NEW |