Commit 41dee0dd authored by tfarina@chromium.org's avatar tfarina@chromium.org

intents: Constantify some getter accessors.

R=gbillock@chromium.org
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/10834174

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150965 0039d316-1c4b-4281-b951-d872f2087c98
parent 59c19899
...@@ -219,7 +219,7 @@ void WebIntentPickerController::ShowDialog(const string16& action, ...@@ -219,7 +219,7 @@ void WebIntentPickerController::ShowDialog(const string16& action,
picker_model_->Clear(); picker_model_->Clear();
picker_model_->set_action(action); picker_model_->set_action(action);
picker_model_->set_mimetype(type); picker_model_->set_type(type);
// If the intent is explicit, skip showing the picker. // If the intent is explicit, skip showing the picker.
if (intents_dispatcher_) { if (intents_dispatcher_) {
...@@ -382,7 +382,7 @@ void WebIntentPickerController::OnSuggestionsLinkClicked() { ...@@ -382,7 +382,7 @@ void WebIntentPickerController::OnSuggestionsLinkClicked() {
browser::FindBrowserWithWebContents(tab_contents_->web_contents()); browser::FindBrowserWithWebContents(tab_contents_->web_contents());
GURL query_url = extension_urls::GetWebstoreIntentQueryURL( GURL query_url = extension_urls::GetWebstoreIntentQueryURL(
UTF16ToUTF8(picker_model_->action()), UTF16ToUTF8(picker_model_->action()),
UTF16ToUTF8(picker_model_->mimetype())); UTF16ToUTF8(picker_model_->type()));
chrome::NavigateParams params(browser, query_url, chrome::NavigateParams params(browser, query_url,
content::PAGE_TRANSITION_AUTO_BOOKMARK); content::PAGE_TRANSITION_AUTO_BOOKMARK);
params.disposition = NEW_FOREGROUND_TAB; params.disposition = NEW_FOREGROUND_TAB;
...@@ -434,7 +434,7 @@ void WebIntentPickerController::DispatchToInstalledExtension( ...@@ -434,7 +434,7 @@ void WebIntentPickerController::DispatchToInstalledExtension(
picker_->OnExtensionInstallSuccess(extension_id); picker_->OnExtensionInstallSuccess(extension_id);
WebIntentsRegistry::IntentServiceList services; WebIntentsRegistry::IntentServiceList services;
GetWebIntentsRegistry(tab_contents_)->GetIntentServicesForExtensionFilter( GetWebIntentsRegistry(tab_contents_)->GetIntentServicesForExtensionFilter(
picker_model_->action(), picker_model_->mimetype(), picker_model_->action(), picker_model_->type(),
extension_id, extension_id,
&services); &services);
......
...@@ -56,7 +56,7 @@ void WebIntentPickerModel::RemoveInstalledServiceAt(size_t index) { ...@@ -56,7 +56,7 @@ void WebIntentPickerModel::RemoveInstalledServiceAt(size_t index) {
void WebIntentPickerModel::Clear() { void WebIntentPickerModel::Clear() {
DestroyAll(); DestroyAll();
action_.clear(); action_.clear();
mimetype_.clear(); type_.clear();
inline_disposition_url_ = GURL::EmptyGURL(); inline_disposition_url_ = GURL::EmptyGURL();
if (observer_) if (observer_)
observer_->OnModelChanged(this); observer_->OnModelChanged(this);
......
...@@ -7,16 +7,13 @@ ...@@ -7,16 +7,13 @@
#include <vector> #include <vector>
#include "base/basictypes.h"
#include "base/string16.h" #include "base/string16.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
class WebIntentPickerModelObserver; class WebIntentPickerModelObserver;
namespace gfx {
class Image;
}
// Model for the WebIntentPicker. // Model for the WebIntentPicker.
class WebIntentPickerModel { class WebIntentPickerModel {
public: public:
...@@ -74,20 +71,17 @@ class WebIntentPickerModel { ...@@ -74,20 +71,17 @@ class WebIntentPickerModel {
observer_ = observer; observer_ = observer;
} }
const string16& action() const { return action_; }
void set_action(const string16& action) { action_ = action; } void set_action(const string16& action) { action_ = action; }
const string16& action() { return action_; } const string16& type() const { return type_; }
void set_type(const string16& type) { type_ = type; }
void set_mimetype(const string16& mimetype) { mimetype_ = mimetype; }
const string16& mimetype() { return mimetype_; }
const GURL& default_service_url() const { return default_service_url_; }
void set_default_service_url(const GURL& default_url) { void set_default_service_url(const GURL& default_url) {
default_service_url_ = default_url; default_service_url_ = default_url;
} }
const GURL& default_service_url() { return default_service_url_; }
// Add a new installed service with |title|, |url| and |disposition| to the // Add a new installed service with |title|, |url| and |disposition| to the
// picker. // picker.
void AddInstalledService(const string16& title, void AddInstalledService(const string16& title,
...@@ -145,7 +139,7 @@ class WebIntentPickerModel { ...@@ -145,7 +139,7 @@ class WebIntentPickerModel {
// Returns the url of the intent service that is being displayed inline, or // Returns the url of the intent service that is being displayed inline, or
// GURL::EmptyGURL() if none. // GURL::EmptyGURL() if none.
GURL inline_disposition_url() const { return inline_disposition_url_; } const GURL& inline_disposition_url() const { return inline_disposition_url_; }
private: private:
// Delete all elements in |installed_services_| and |suggested_extensions_|. // Delete all elements in |installed_services_| and |suggested_extensions_|.
...@@ -160,7 +154,7 @@ class WebIntentPickerModel { ...@@ -160,7 +154,7 @@ class WebIntentPickerModel {
// by this model. // by this model.
std::vector<SuggestedExtension*> suggested_extensions_; std::vector<SuggestedExtension*> suggested_extensions_;
// The observer to send notifications to, or NULL if none. // The observer to send notifications to, or NULL if none. Not owned.
WebIntentPickerModelObserver* observer_; WebIntentPickerModelObserver* observer_;
// The url of the intent service that is being displayed inline, or // The url of the intent service that is being displayed inline, or
...@@ -170,8 +164,8 @@ class WebIntentPickerModel { ...@@ -170,8 +164,8 @@ class WebIntentPickerModel {
// A cached copy of the action that instantiated the picker. // A cached copy of the action that instantiated the picker.
string16 action_; string16 action_;
// A cached copy of the mimetype that instantiated the picker. // A cached copy of the type that instantiated the picker.
string16 mimetype_; string16 type_;
// The non-empty url of the default service if the WebIntentsRegistry // The non-empty url of the default service if the WebIntentsRegistry
// finds a default service matching the intent being dispatched. // finds a default service matching the intent being dispatched.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment