| 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_controller.h" | 5 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/extensions/platform_app_launcher.h" | 14 #include "chrome/browser/extensions/platform_app_launcher.h" |
| 15 #include "chrome/browser/extensions/webstore_installer.h" | 15 #include "chrome/browser/extensions/webstore_installer.h" |
| 16 #include "chrome/browser/favicon/favicon_service.h" | 16 #include "chrome/browser/favicon/favicon_service.h" |
| 17 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 17 #include "chrome/browser/intents/cws_intents_registry_factory.h" | 18 #include "chrome/browser/intents/cws_intents_registry_factory.h" |
| 18 #include "chrome/browser/intents/default_web_intent_service.h" | 19 #include "chrome/browser/intents/default_web_intent_service.h" |
| 19 #include "chrome/browser/intents/web_intents_registry_factory.h" | 20 #include "chrome/browser/intents/web_intents_registry_factory.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/tab_contents/tab_util.h" | 22 #include "chrome/browser/tab_contents/tab_util.h" |
| 22 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_finder.h" | 24 #include "chrome/browser/ui/browser_finder.h" |
| 24 #include "chrome/browser/ui/browser_list.h" | 25 #include "chrome/browser/ui/browser_list.h" |
| 25 #include "chrome/browser/ui/browser_navigator.h" | 26 #include "chrome/browser/ui/browser_navigator.h" |
| 26 #include "chrome/browser/ui/browser_tabstrip.h" | 27 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 55 | 56 |
| 56 const char kShareActionURL[] = "http://webintents.org/share"; | 57 const char kShareActionURL[] = "http://webintents.org/share"; |
| 57 const char kEditActionURL[] = "http://webintents.org/edit"; | 58 const char kEditActionURL[] = "http://webintents.org/edit"; |
| 58 const char kViewActionURL[] = "http://webintents.org/view"; | 59 const char kViewActionURL[] = "http://webintents.org/view"; |
| 59 const char kPickActionURL[] = "http://webintents.org/pick"; | 60 const char kPickActionURL[] = "http://webintents.org/pick"; |
| 60 const char kSubscribeActionURL[] = "http://webintents.org/subscribe"; | 61 const char kSubscribeActionURL[] = "http://webintents.org/subscribe"; |
| 61 const char kSaveActionURL[] = "http://webintents.org/save"; | 62 const char kSaveActionURL[] = "http://webintents.org/save"; |
| 62 | 63 |
| 63 // Gets the favicon service for the profile in |tab_contents|. | 64 // Gets the favicon service for the profile in |tab_contents|. |
| 64 FaviconService* GetFaviconService(TabContents* tab_contents) { | 65 FaviconService* GetFaviconService(TabContents* tab_contents) { |
| 65 return tab_contents->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 66 return FaviconServiceFactory::GetForProfile(tab_contents->profile(), |
| 67 Profile::EXPLICIT_ACCESS); |
| 66 } | 68 } |
| 67 | 69 |
| 68 // Gets the web intents registry for the profile in |tab_contents|. | 70 // Gets the web intents registry for the profile in |tab_contents|. |
| 69 WebIntentsRegistry* GetWebIntentsRegistry(TabContents* tab_contents) { | 71 WebIntentsRegistry* GetWebIntentsRegistry(TabContents* tab_contents) { |
| 70 return WebIntentsRegistryFactory::GetForProfile(tab_contents->profile()); | 72 return WebIntentsRegistryFactory::GetForProfile(tab_contents->profile()); |
| 71 } | 73 } |
| 72 | 74 |
| 73 // Gets the Chrome web store intents registry for the profile in |tab_contents|. | 75 // Gets the Chrome web store intents registry for the profile in |tab_contents|. |
| 74 CWSIntentsRegistry* GetCWSIntentsRegistry(TabContents* tab_contents) { | 76 CWSIntentsRegistry* GetCWSIntentsRegistry(TabContents* tab_contents) { |
| 75 return CWSIntentsRegistryFactory::GetForProfile(tab_contents->profile()); | 77 return CWSIntentsRegistryFactory::GetForProfile(tab_contents->profile()); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 // If picker is non-NULL, it was set by a test. | 768 // If picker is non-NULL, it was set by a test. |
| 767 if (picker_ == NULL) | 769 if (picker_ == NULL) |
| 768 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); | 770 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); |
| 769 picker_shown_ = true; | 771 picker_shown_ = true; |
| 770 } | 772 } |
| 771 | 773 |
| 772 void WebIntentPickerController::ClosePicker() { | 774 void WebIntentPickerController::ClosePicker() { |
| 773 if (picker_) | 775 if (picker_) |
| 774 picker_->Close(); | 776 picker_->Close(); |
| 775 } | 777 } |
| OLD | NEW |