| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INSTANT_TAB_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class WebContents; | 16 class WebContents; |
| 17 } | 17 } |
| 18 | 18 |
| 19 // InstantTab is used to exchange messages with a page that implements the | 19 // InstantTab is instantiated by InstantController for the current tab if it |
| 20 // Instant/Embedded Search API (http://dev.chromium.org/embeddedsearch). | 20 // is a New Tab page. |
| 21 class InstantTab : public content::WebContentsObserver { | 21 class InstantTab : public content::WebContentsObserver { |
| 22 public: | 22 public: |
| 23 // InstantTab calls its delegate in response to messages received from the | 23 // InstantTab calls its delegate in response to messages received from the |
| 24 // page. Each method is called with the |contents| corresponding to the page | 24 // page. Each method is called with the |contents| corresponding to the page |
| 25 // we are observing. | 25 // we are observing. |
| 26 class Delegate { | 26 class Delegate { |
| 27 public: | 27 public: |
| 28 // Called when the page is about to navigate to |url|. | 28 // Called when the page is about to navigate to |url|. |
| 29 virtual void InstantTabAboutToNavigateMainFrame( | 29 virtual void InstantTabAboutToNavigateMainFrame( |
| 30 const content::WebContents* contents, | 30 const content::WebContents* contents, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 content::NavigationHandle* navigation_handle) override; | 47 content::NavigationHandle* navigation_handle) override; |
| 48 | 48 |
| 49 Delegate* const delegate_; | 49 Delegate* const delegate_; |
| 50 | 50 |
| 51 content::WebContents* pending_web_contents_; | 51 content::WebContents* pending_web_contents_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(InstantTab); | 53 DISALLOW_COPY_AND_ASSIGN(InstantTab); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ | 56 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| OLD | NEW |