| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| 11 | 11 |
| 12 namespace app_list { | 12 namespace app_list { |
| 13 class AnswerCardResult; | 13 class AnswerCardResult; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { | |
| 17 class NavigationHandle; | |
| 18 struct OpenURLParams; | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 namespace gfx { | 16 namespace gfx { |
| 23 class Size; | 17 class Size; |
| 24 } | 18 } |
| 25 | 19 |
| 26 namespace views { | 20 namespace views { |
| 27 class View; | 21 class View; |
| 28 } | 22 } |
| 29 | 23 |
| 30 namespace app_list { | 24 namespace app_list { |
| 31 | 25 |
| 32 // Abstract source of contents for AnswerCardSearchProvider. | 26 // Abstract source of contents for AnswerCardSearchProvider. |
| 33 class AnswerCardContents { | 27 class AnswerCardContents { |
| 34 public: | 28 public: |
| 35 // Delegate handling contents-related events. | 29 // Delegate handling contents-related events. |
| 36 class Delegate { | 30 class Delegate { |
| 37 public: | 31 public: |
| 38 Delegate() {} | 32 Delegate() {} |
| 39 | 33 |
| 40 // Events that the delegate processes. They have same meaning as same-named | 34 // Events that the delegate processes. They have same meaning as same-named |
| 41 // events in WebContentsDelegate and WebContentsObserver, however, | 35 // events in WebContentsDelegate and WebContentsObserver, however, |
| 42 // unnecessary parameters are omitted. | 36 // unnecessary parameters are omitted. |
| 43 virtual void UpdatePreferredSize(const gfx::Size& pref_size) = 0; | 37 virtual void UpdatePreferredSize(const gfx::Size& pref_size) = 0; |
| 44 virtual content::WebContents* OpenURLFromTab( | 38 virtual void DidFinishNavigation(const GURL& url, |
| 45 const content::OpenURLParams& params) = 0; | 39 bool has_error, |
| 46 virtual void DidFinishNavigation( | 40 bool has_answer_card, |
| 47 content::NavigationHandle* navigation_handle) = 0; | 41 const std::string& result_title, |
| 42 const std::string& issued_query) = 0; |
| 48 virtual void DidStopLoading() = 0; | 43 virtual void DidStopLoading() = 0; |
| 49 | 44 |
| 50 private: | 45 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(Delegate); | 46 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 52 }; | 47 }; |
| 53 | 48 |
| 54 AnswerCardContents(); | 49 AnswerCardContents(); |
| 55 virtual ~AnswerCardContents(); | 50 virtual ~AnswerCardContents(); |
| 56 | 51 |
| 57 // Loads contents from |url|. | 52 // Loads contents from |url|. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 80 Delegate* delegate_ = nullptr; | 75 Delegate* delegate_ = nullptr; |
| 81 // Whether the mouse is in |view()|. | 76 // Whether the mouse is in |view()|. |
| 82 bool mouse_is_in_view_ = false; | 77 bool mouse_is_in_view_ = false; |
| 83 | 78 |
| 84 DISALLOW_COPY_AND_ASSIGN(AnswerCardContents); | 79 DISALLOW_COPY_AND_ASSIGN(AnswerCardContents); |
| 85 }; | 80 }; |
| 86 | 81 |
| 87 } // namespace app_list | 82 } // namespace app_list |
| 88 | 83 |
| 89 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ | 84 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_ANSWER_CARD_ANSWER_CARD_CONTENTS_H_ |
| OLD | NEW |