Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker.cc

Issue 11035017: Mac Web Intents Part 15: Inline extension install prompt (model) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_dialog.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 = WebIntentPicker::kWindowMaxWidth; 22 const int kMaxInlineDispositionWidth = WebIntentPicker::kWindowMaxWidth;
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 ShowExtensionInstallDialogImpl(parent, navigator, delegate, prompt);
33 }
34
26 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() { 35 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() {
27 return gfx::Size(1, 1); 36 return gfx::Size(1, 1);
28 } 37 }
29 38
30 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() { 39 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() {
31 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight); 40 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight);
32 } 41 }
33 42
34 // static 43 // static
35 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) { 44 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 else if (!action.compare(web_intents::kActionPick)) 78 else if (!action.compare(web_intents::kActionPick))
70 // Using generic string per UX suggestions. 79 // Using generic string per UX suggestions.
71 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); 80 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE);
72 else if (!action.compare(web_intents::kActionSubscribe)) 81 else if (!action.compare(web_intents::kActionSubscribe))
73 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SUBSCRIBE); 82 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SUBSCRIBE);
74 else if (!action.compare(web_intents::kActionSave)) 83 else if (!action.compare(web_intents::kActionSave))
75 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SAVE); 84 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_ACTION_SAVE);
76 else 85 else
77 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE); 86 return l10n_util::GetStringUTF16(IDS_INTENT_PICKER_CHOOSE_SERVICE);
78 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698