| 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 #include "chrome/browser/ui/intents/web_intent_picker.h" | 5 #include "chrome/browser/ui/intents/web_intent_picker.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 10 #include "chrome/browser/intents/web_intents_util.h" | 11 #include "chrome/browser/intents/web_intents_util.h" |
| 11 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/browser/web_contents_view.h" | 13 #include "content/public/browser/web_contents_view.h" |
| 13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 14 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 // Maximum inline disposition container sizes. | 21 // Maximum inline disposition container sizes. |
| 21 const int kMaxInlineDispositionWidth = 900; | 22 const int kMaxInlineDispositionWidth = 900; |
| 22 const int kMaxInlineDispositionHeight = 900; | 23 const int kMaxInlineDispositionHeight = 900; |
| 23 | 24 |
| 24 } // namespace | 25 } // namespace |
| 25 | 26 |
| 27 void WebIntentPicker::OnShowExtensionInstallDialog( |
| 28 gfx::NativeWindow parent, |
| 29 content::PageNavigator* navigator, |
| 30 ExtensionInstallPrompt::Delegate* delegate, |
| 31 const ExtensionInstallPrompt::Prompt& prompt) { |
| 32 ExtensionInstallPrompt::GetDefaultShowDialogCallback().Run( |
| 33 parent, navigator, delegate, prompt); |
| 34 } |
| 35 |
| 26 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() { | 36 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() { |
| 27 return gfx::Size(1, 1); | 37 return gfx::Size(1, 1); |
| 28 } | 38 } |
| 29 | 39 |
| 30 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() { | 40 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() { |
| 31 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight); | 41 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight); |
| 32 } | 42 } |
| 33 | 43 |
| 34 // static | 44 // static |
| 35 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) { | 45 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 else if (!action.compare(web_intents::kActionPick)) | 79 else if (!action.compare(web_intents::kActionPick)) |
| 70 // Using generic string per UX suggestions. | 80 // Using generic string per UX suggestions. |
| 71 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); | 81 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); |
| 72 else if (!action.compare(web_intents::kActionSubscribe)) | 82 else if (!action.compare(web_intents::kActionSubscribe)) |
| 73 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SUBSCRIBE); | 83 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SUBSCRIBE); |
| 74 else if (!action.compare(web_intents::kActionSave)) | 84 else if (!action.compare(web_intents::kActionSave)) |
| 75 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SAVE); | 85 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SAVE); |
| 76 else | 86 else |
| 77 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); | 87 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); |
| 78 } | 88 } |
| OLD | NEW |