| 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_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/ui/intents/web_intent_picker_factory.h" | 11 #include "chrome/browser/ui/intents/web_intent_picker_factory.h" |
| 12 | 12 |
| 13 class TabContents; | 13 class TabContents; |
| 14 class WebIntentPickerDelegate; | 14 class WebIntentPickerDelegate; |
| 15 | 15 |
| 16 // A factory for creating a constrained dialog as the intent picker UI for a | 16 // A factory for creating a constrained dialog as the intent picker UI for a |
| 17 // given TabContents. | 17 // given TabContents. |
| 18 class WebIntentConstrainedDialogFactory : public WebIntentPickerFactory { | 18 class WebIntentConstrainedDialogFactory : public WebIntentPickerFactory { |
| 19 public: | 19 public: |
| 20 WebIntentConstrainedDialogFactory(); | 20 WebIntentConstrainedDialogFactory(); |
| 21 virtual ~WebIntentConstrainedDialogFactory(); | 21 virtual ~WebIntentConstrainedDialogFactory(); |
| 22 | 22 |
| 23 // WebIntentPickerFactory implementation. | 23 // WebIntentPickerFactory implementation. |
| 24 virtual WebIntentPicker* Create( | 24 virtual WebIntentPicker* Create( |
| 25 TabContents* tab_contents, | 25 TabContentsWrapper* wrapper, |
| 26 WebIntentPickerDelegate* delegate) OVERRIDE; | 26 WebIntentPickerDelegate* delegate) OVERRIDE; |
| 27 virtual void ClosePicker(WebIntentPicker* picker) OVERRIDE; | 27 virtual void ClosePicker(WebIntentPicker* picker) OVERRIDE; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // Closes the dialog and destroys it. | 30 // Closes the dialog and destroys it. |
| 31 void CloseDialog(); | 31 void CloseDialog(); |
| 32 | 32 |
| 33 // A weak pointer to the currently active picker, or NULL if there is no | 33 // A weak pointer to the currently active picker, or NULL if there is no |
| 34 // active picker. | 34 // active picker. |
| 35 WebIntentPicker* picker_; | 35 WebIntentPicker* picker_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(WebIntentConstrainedDialogFactory); | 37 DISALLOW_COPY_AND_ASSIGN(WebIntentConstrainedDialogFactory); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ | 40 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_CONSTRAINED_DIALOG_FACTORY_H_ |
| OLD | NEW |