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

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: Merge to head 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 e5b7b4ec758282f9d95d1554420dd3878383a070..b46bfe4e0df7becf974c06d7ba0a5029dbf5fceb 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -75,19 +75,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))
@@ -280,8 +267,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);
@@ -297,14 +285,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(
@@ -448,9 +436,7 @@ 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));
+ OnServiceChosen(service_data.service_url, service_data.disposition);
AsyncOperationFinished();
}
@@ -496,7 +482,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(
@@ -532,8 +518,7 @@ void WebIntentPickerController::WebIntentServicesForExplicitIntent(
if (services[i].disposition ==
webkit_glue::WebIntentServiceData::DISPOSITION_INLINE)
CreatePicker();
- OnServiceChosen(services[i].service_url,
- ConvertDisposition(services[i].disposition));
+ OnServiceChosen(services[i].service_url, services[i].disposition);
AsyncOperationFinished();
return;
}
@@ -570,7 +555,7 @@ void WebIntentPickerController::RegistryCallsCompleted() {
if (default_service != NULL) {
if (default_service->disposition ==
- WebIntentPickerModel::DISPOSITION_INLINE)
+ webkit_glue::WebIntentServiceData::DISPOSITION_INLINE)
CreatePicker();
OnServiceChosen(default_service->url, default_service->disposition);

Powered by Google App Engine
This is Rietveld 408576698