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

Unified Diff: chrome/browser/ui/intents/web_intent_picker_controller.cc

Issue 10855066: intents: Remove the disposition enum in web intents model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mock type. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/intents/web_intent_picker_controller.cc
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc
index 84eb7f829472def094ca6684a085400b38e23710..74246aee6a17f8027bc358d5ad3471cfa4053f1c 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -48,7 +48,6 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image.h"
-#include "webkit/glue/web_intent_service_data.h"
using extensions::WebstoreInstaller;
@@ -83,19 +82,6 @@ CWSIntentsRegistry* GetCWSIntentsRegistry(TabContents* tab_contents) {
return CWSIntentsRegistryFactory::GetForProfile(tab_contents->profile());
}
-WebIntentPickerModel::Disposition ConvertDisposition(
- webkit_glue::WebIntentServiceData::Disposition disposition) {
- switch (disposition) {
- case webkit_glue::WebIntentServiceData::DISPOSITION_INLINE:
- return WebIntentPickerModel::DISPOSITION_INLINE;
- case webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW:
- return WebIntentPickerModel::DISPOSITION_WINDOW;
- default:
- NOTREACHED();
- return WebIntentPickerModel::DISPOSITION_WINDOW;
- }
-}
-
// Returns the action-specific string for |action|.
string16 GetIntentActionString(const std::string& action) {
if (!action.compare(kShareActionURL))
@@ -298,8 +284,9 @@ void WebIntentPickerController::Observe(
ClosePicker();
}
-void WebIntentPickerController::OnServiceChosen(const GURL& url,
- Disposition disposition) {
+void WebIntentPickerController::OnServiceChosen(
+ const GURL& url,
+ webkit_glue::WebIntentServiceData::Disposition disposition) {
ExtensionService* service = tab_contents_->profile()->GetExtensionService();
DCHECK(service);
const extensions::Extension* extension = service->GetInstalledApp(url);
@@ -315,14 +302,14 @@ void WebIntentPickerController::OnServiceChosen(const GURL& url,
}
switch (disposition) {
- case WebIntentPickerModel::DISPOSITION_INLINE:
+ case webkit_glue::WebIntentServiceData::DISPOSITION_INLINE:
// Set the model to inline disposition. It will notify the picker which
// will respond (via OnInlineDispositionWebContentsCreated) with the
// WebContents to dispatch the intent to.
picker_model_->SetInlineDisposition(url);
break;
- case WebIntentPickerModel::DISPOSITION_WINDOW: {
+ case webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW: {
Browser* browser = browser::FindBrowserWithWebContents(
tab_contents_->web_contents());
TabContents* contents = chrome::TabContentsFactory(
@@ -465,10 +452,8 @@ void WebIntentPickerController::DispatchToInstalledExtension(
picker_model_->AddInstalledService(
service_data.title, service_data.service_url,
- ConvertDisposition(service_data.disposition));
- OnServiceChosen(
- service_data.service_url,
- ConvertDisposition(service_data.disposition));
+ service_data.disposition);
+ OnServiceChosen(service_data.service_url, service_data.disposition);
AsyncOperationFinished();
}
@@ -514,7 +499,7 @@ void WebIntentPickerController::AddServiceToModel(
picker_model_->AddInstalledService(
service.title,
service.service_url,
- ConvertDisposition(service.disposition));
+ service.disposition);
pending_async_count_++;
FaviconService::Handle handle = favicon_service->GetFaviconForURL(
@@ -825,7 +810,8 @@ void WebIntentPickerController::AsyncOperationFinished() {
void WebIntentPickerController::InvokeService(
const WebIntentPickerModel::InstalledService& service) {
- if (service.disposition == WebIntentPickerModel::DISPOSITION_INLINE) {
+ if (service.disposition ==
+ webkit_glue::WebIntentServiceData::DISPOSITION_INLINE) {
SetDialogState(kPickerMain);
}
OnServiceChosen(service.url, service.disposition);

Powered by Google App Engine
This is Rietveld 408576698