| 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_INSTANT_INSTANT_CLIENT_H_ |    5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 
|    6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |    6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 
|    7  |    7  | 
|    8 #include <vector> |    8 #include <vector> | 
|    9  |    9  | 
|   10 #include "base/basictypes.h" |   10 #include "base/basictypes.h" | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   51                                     InstantSizeUnits units) = 0; |   51                                     InstantSizeUnits units) = 0; | 
|   52  |   52  | 
|   53     // Called when the page wants the browser to start capturing user key |   53     // Called when the page wants the browser to start capturing user key | 
|   54     // strokes. |   54     // strokes. | 
|   55     virtual void StartCapturingKeyStrokes() = 0; |   55     virtual void StartCapturingKeyStrokes() = 0; | 
|   56  |   56  | 
|   57     // Called when the page wants the browser to stop capturing user key |   57     // Called when the page wants the browser to stop capturing user key | 
|   58     // strokes. |   58     // strokes. | 
|   59     virtual void StopCapturingKeyStrokes() = 0; |   59     virtual void StopCapturingKeyStrokes() = 0; | 
|   60  |   60  | 
 |   61     // Called when the page is about to navigate. | 
 |   62     virtual void InstantClientAboutToNavigate(const GURL& url) = 0; | 
 |   63  | 
|   61    protected: |   64    protected: | 
|   62     virtual ~Delegate(); |   65     virtual ~Delegate(); | 
|   63   }; |   66   }; | 
|   64  |   67  | 
|   65   // Doesn't take ownership of |delegate|. |   68   // Doesn't take ownership of |delegate|. | 
|   66   explicit InstantClient(Delegate* delegate); |   69   explicit InstantClient(Delegate* delegate); | 
|   67   virtual ~InstantClient(); |   70   virtual ~InstantClient(); | 
|   68  |   71  | 
|   69   // Sets |contents| as the page to communicate with. |contents| can be NULL, |   72   // Sets |contents| as the page to communicate with. |contents| can be NULL, | 
|   70   // which effectively stops all communication. |   73   // which effectively stops all communication. | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  116   void SetDisplayInstantResults(bool display_instant_results); |  119   void SetDisplayInstantResults(bool display_instant_results); | 
|  117  |  120  | 
|  118  private: |  121  private: | 
|  119   // Overridden from content::WebContentsObserver: |  122   // Overridden from content::WebContentsObserver: | 
|  120   virtual void DidFinishLoad( |  123   virtual void DidFinishLoad( | 
|  121       int64 frame_id, |  124       int64 frame_id, | 
|  122       const GURL& validated_url, |  125       const GURL& validated_url, | 
|  123       bool is_main_frame, |  126       bool is_main_frame, | 
|  124       content::RenderViewHost* render_view_host) OVERRIDE; |  127       content::RenderViewHost* render_view_host) OVERRIDE; | 
|  125   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |  128   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 
 |  129   virtual void DidCommitProvisionalLoadForFrame( | 
 |  130       int64 frame_id, | 
 |  131       bool is_main_frame, | 
 |  132       const GURL& url, | 
 |  133       content::PageTransition transition_type, | 
 |  134       content::RenderViewHost* render_view_host) OVERRIDE; | 
 |  135   virtual void AboutToOpenURL(const GURL& url) OVERRIDE; | 
|  126  |  136  | 
|  127   void SetSuggestions(int page_id, |  137   void SetSuggestions(int page_id, | 
|  128                       const std::vector<InstantSuggestion>& suggestions); |  138                       const std::vector<InstantSuggestion>& suggestions); | 
|  129   void InstantSupportDetermined(int page_id, bool result); |  139   void InstantSupportDetermined(int page_id, bool result); | 
|  130   void ShowInstantPreview(int page_id, |  140   void ShowInstantPreview(int page_id, | 
|  131                           InstantShownReason reason, |  141                           InstantShownReason reason, | 
|  132                           int height, |  142                           int height, | 
|  133                           InstantSizeUnits units); |  143                           InstantSizeUnits units); | 
|  134   void StartCapturingKeyStrokes(int page_id); |  144   void StartCapturingKeyStrokes(int page_id); | 
|  135   void StopCapturingKeyStrokes(int page_id); |  145   void StopCapturingKeyStrokes(int page_id); | 
|  136  |  146  | 
|  137   Delegate* const delegate_; |  147   Delegate* const delegate_; | 
|  138  |  148  | 
|  139   DISALLOW_COPY_AND_ASSIGN(InstantClient); |  149   DISALLOW_COPY_AND_ASSIGN(InstantClient); | 
|  140 }; |  150 }; | 
|  141  |  151  | 
|  142 #endif  // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |  152 #endif  // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 
| OLD | NEW |