| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 | 14 |
| 15 class TabContents; | |
| 16 class WebIntentPickerDelegate; | 15 class WebIntentPickerDelegate; |
| 17 class WebIntentPickerModel; | 16 class WebIntentPickerModel; |
| 18 | 17 |
| 19 namespace content { | 18 namespace content { |
| 20 class WebContents; | 19 class WebContents; |
| 21 } | 20 } |
| 22 | 21 |
| 23 // Base class for the web intent picker dialog. | 22 // Base class for the web intent picker dialog. |
| 24 class WebIntentPicker { | 23 class WebIntentPicker { |
| 25 public: | 24 public: |
| 26 // The width of the window, in view coordinates. The height will be | 25 // The width of the window, in view coordinates. The height will be |
| 27 // determined by the content. | 26 // determined by the content. |
| 28 static const int kWindowWidth = 400; | 27 static const int kWindowWidth = 400; |
| 29 | 28 |
| 30 // The maximum width in view units of a suggested extension's title link. | 29 // The maximum width in view units of a suggested extension's title link. |
| 31 static const int kTitleLinkMaxWidth = 130; | 30 static const int kTitleLinkMaxWidth = 130; |
| 32 | 31 |
| 33 // The space in pixels between the top-level groups and the dialog border. | 32 // The space in pixels between the top-level groups and the dialog border. |
| 34 static const int kContentAreaBorder = 10; | 33 static const int kContentAreaBorder = 10; |
| 35 | 34 |
| 36 // Platform specific factory function. This function will automatically show | 35 // Platform specific factory function. This function will automatically show |
| 37 // the picker. | 36 // the picker. |
| 38 static WebIntentPicker* Create(TabContents* tab_contents, | 37 static WebIntentPicker* Create(content::WebContents* web_contents, |
| 39 WebIntentPickerDelegate* delegate, | 38 WebIntentPickerDelegate* delegate, |
| 40 WebIntentPickerModel* model); | 39 WebIntentPickerModel* model); |
| 41 | 40 |
| 42 // Hides the UI for this picker, and destroys its UI. | 41 // Hides the UI for this picker, and destroys its UI. |
| 43 virtual void Close() = 0; | 42 virtual void Close() = 0; |
| 44 | 43 |
| 45 // Sets the action string of the picker, e.g., | 44 // Sets the action string of the picker, e.g., |
| 46 // "Which service should be used for sharing?". | 45 // "Which service should be used for sharing?". |
| 47 virtual void SetActionString(const string16& action) = 0; | 46 virtual void SetActionString(const string16& action) = 0; |
| 48 | 47 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 | 70 |
| 72 // Get the star image IDs to use for the nth star (out of 5), given a | 71 // Get the star image IDs to use for the nth star (out of 5), given a |
| 73 // |rating| in the range [0, 5]. | 72 // |rating| in the range [0, 5]. |
| 74 static int GetNthStarImageIdFromCWSRating(double rating, int index); | 73 static int GetNthStarImageIdFromCWSRating(double rating, int index); |
| 75 | 74 |
| 76 protected: | 75 protected: |
| 77 virtual ~WebIntentPicker() {} | 76 virtual ~WebIntentPicker() {} |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ | 79 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| OLD | NEW |