| 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_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |    5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 
|    6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |    6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 
|    7 #pragma once |    7 #pragma once | 
|    8  |    8  | 
|    9 #include <vector> |    9 #include <vector> | 
|   10  |   10  | 
|   11 #include "base/compiler_specific.h" |   11 #include "base/compiler_specific.h" | 
|   12 #include "base/memory/scoped_ptr.h" |   12 #include "base/memory/scoped_ptr.h" | 
|   13 #include "base/memory/weak_ptr.h" |   13 #include "base/memory/weak_ptr.h" | 
|   14 #include "base/string16.h" |   14 #include "base/string16.h" | 
|   15 #include "chrome/browser/favicon/favicon_service.h" |   15 #include "chrome/browser/favicon/favicon_service.h" | 
|   16 #include "chrome/browser/intents/web_intents_registry.h" |   16 #include "chrome/browser/intents/web_intents_registry.h" | 
|   17 #include "chrome/browser/intents/cws_intents_registry.h" |   17 #include "chrome/browser/intents/cws_intents_registry.h" | 
|   18 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |   18 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 
|   19 #include "content/public/browser/notification_observer.h" |   19 #include "content/public/browser/notification_observer.h" | 
|   20 #include "content/public/browser/notification_registrar.h" |   20 #include "content/public/browser/notification_registrar.h" | 
|   21 #include "webkit/glue/web_intent_data.h" |   21 #include "webkit/glue/web_intent_data.h" | 
|   22 #include "webkit/glue/web_intent_reply_data.h" |   22 #include "webkit/glue/web_intent_reply_data.h" | 
|   23  |   23  | 
|   24 class Browser; |   24 class Browser; | 
 |   25 class DefaultWebIntentService; | 
|   25 class GURL; |   26 class GURL; | 
|   26 class TabContents; |   27 class TabContents; | 
|   27 class TabContentsWrapper; |   28 class TabContentsWrapper; | 
|   28 class WebIntentPicker; |   29 class WebIntentPicker; | 
|   29 class WebIntentPickerModel; |   30 class WebIntentPickerModel; | 
|   30  |   31  | 
|   31 namespace content { |   32 namespace content { | 
|   32 class WebContents; |   33 class WebContents; | 
|   33 class WebIntentsDispatcher; |   34 class WebIntentsDispatcher; | 
|   34 } |   35 } | 
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   90   // Exposed for tests only. |   91   // Exposed for tests only. | 
|   91   void set_model_observer(WebIntentPickerModelObserver* observer) { |   92   void set_model_observer(WebIntentPickerModelObserver* observer) { | 
|   92     picker_model_->set_observer(observer); |   93     picker_model_->set_observer(observer); | 
|   93   } |   94   } | 
|   94  |   95  | 
|   95   // Called when WebIntentServiceData is returned from the WebIntentsRegistry. |   96   // Called when WebIntentServiceData is returned from the WebIntentsRegistry. | 
|   96   virtual void OnIntentsQueryDone( |   97   virtual void OnIntentsQueryDone( | 
|   97       WebIntentsRegistry::QueryID, |   98       WebIntentsRegistry::QueryID, | 
|   98       const std::vector<webkit_glue::WebIntentServiceData>& services) OVERRIDE; |   99       const std::vector<webkit_glue::WebIntentServiceData>& services) OVERRIDE; | 
|   99  |  100  | 
 |  101   // Called when the WebIntentsRegistry returns responses to a defaults request. | 
 |  102   virtual void OnIntentsDefaultsQueryDone( | 
 |  103       WebIntentsRegistry::QueryID, | 
 |  104       const DefaultWebIntentService& default_service) OVERRIDE; | 
 |  105  | 
|  100   // Called when FaviconData is returned from the FaviconService. |  106   // Called when FaviconData is returned from the FaviconService. | 
|  101   void OnFaviconDataAvailable(FaviconService::Handle handle, |  107   void OnFaviconDataAvailable(FaviconService::Handle handle, | 
|  102                               history::FaviconData favicon_data); |  108                               history::FaviconData favicon_data); | 
|  103  |  109  | 
|  104   // Called when IntentExtensionInfo is returned from the CWSIntentsRegistry. |  110   // Called when IntentExtensionInfo is returned from the CWSIntentsRegistry. | 
|  105   void OnCWSIntentServicesAvailable( |  111   void OnCWSIntentServicesAvailable( | 
|  106       const CWSIntentsRegistry::IntentExtensionList& extensions); |  112       const CWSIntentsRegistry::IntentExtensionList& extensions); | 
|  107  |  113  | 
|  108   // Decrements the |pending_async_count_| and notifies the picker if it |  114   // Decrements the |pending_async_count_| and notifies the picker if it | 
|  109   // reaches zero. |  115   // reaches zero. | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  145  |  151  | 
|  146   // Request consumer used when asynchronously loading favicons. |  152   // Request consumer used when asynchronously loading favicons. | 
|  147   CancelableRequestConsumerTSimple<size_t> favicon_consumer_; |  153   CancelableRequestConsumerTSimple<size_t> favicon_consumer_; | 
|  148  |  154  | 
|  149   base::WeakPtrFactory<WebIntentPickerController> weak_ptr_factory_; |  155   base::WeakPtrFactory<WebIntentPickerController> weak_ptr_factory_; | 
|  150  |  156  | 
|  151   DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); |  157   DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); | 
|  152 }; |  158 }; | 
|  153  |  159  | 
|  154 #endif  // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |  160 #endif  // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 
| OLD | NEW |