| Index: chrome/browser/ui/views/web_intent_picker_views.cc
|
| diff --git a/chrome/browser/ui/views/web_intent_picker_views.cc b/chrome/browser/ui/views/web_intent_picker_views.cc
|
| index e208843e534528ff80e07ee9346aae27da8bb6be..3a19fdd70e1c3dcb1f42b0e481694ad509c2e305 100644
|
| --- a/chrome/browser/ui/views/web_intent_picker_views.cc
|
| +++ b/chrome/browser/ui/views/web_intent_picker_views.cc
|
| @@ -375,7 +375,6 @@ void SuggestedExtensionsLayout::Layout(views::View* host) {
|
| child_bounds.set_x(std::max(child_area.width() - size.width(), x));
|
| } else if (i == 1) {
|
| // Label is considered fixed width, to align ratings widget.
|
| - DCHECK_LE(size.width(), WebIntentPicker::kTitleLinkMaxWidth);
|
| x += WebIntentPicker::kTitleLinkMaxWidth +
|
| views::kRelatedControlHorizontalSpacing;
|
| } else {
|
| @@ -794,6 +793,7 @@ class WebIntentPickerViews : public views::ButtonListener,
|
| virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE;
|
| virtual void OnInlineDispositionAutoResize(const gfx::Size& size) OVERRIDE;
|
| virtual void OnPendingAsyncCompleted() OVERRIDE;
|
| + virtual void InvalidateDelegate() OVERRIDE;
|
| virtual void OnInlineDispositionWebContentsLoaded(
|
| content::WebContents* web_contents) OVERRIDE;
|
|
|
| @@ -957,11 +957,13 @@ WebIntentPickerViews::~WebIntentPickerViews() {
|
|
|
| void WebIntentPickerViews::ButtonPressed(views::Button* sender,
|
| const ui::Event& event) {
|
| + DCHECK(delegate_);
|
| delegate_->OnUserCancelledPickerDialog();
|
| }
|
|
|
| void WebIntentPickerViews::WindowClosing() {
|
| - delegate_->OnClosing();
|
| + if (delegate_)
|
| + delegate_->OnClosing();
|
| }
|
|
|
| void WebIntentPickerViews::DeleteDelegate() {
|
| @@ -989,6 +991,7 @@ bool WebIntentPickerViews::Cancel() {
|
| }
|
|
|
| void WebIntentPickerViews::LinkClicked(views::Link* source, int event_flags) {
|
| + DCHECK(delegate_);
|
| if (source == more_suggestions_link_) {
|
| delegate_->OnSuggestionsLinkClicked(
|
| chrome::DispositionFromEventFlags(event_flags));
|
| @@ -1039,6 +1042,10 @@ void WebIntentPickerViews::OnPendingAsyncCompleted() {
|
| UpdateContents();
|
| }
|
|
|
| +void WebIntentPickerViews::InvalidateDelegate() {
|
| + delegate_ = NULL;
|
| +}
|
| +
|
| void WebIntentPickerViews::ShowNoServicesMessage() {
|
| ClearContents();
|
|
|
| @@ -1177,11 +1184,13 @@ void WebIntentPickerViews::OnExtensionIconChanged(
|
|
|
| void WebIntentPickerViews::OnInlineDisposition(
|
| const string16&, const GURL& url) {
|
| + DCHECK(delegate_);
|
| if (!webview_)
|
| webview_ = new views::WebView(tab_contents_->profile());
|
|
|
| inline_web_contents_.reset(delegate_->CreateWebContentsForInlineDisposition(
|
| tab_contents_->profile(), url));
|
| +
|
| // Does not take ownership, so we keep a scoped_ptr
|
| // for the WebContents locally.
|
| webview_->SetWebContents(inline_web_contents_.get());
|
| @@ -1208,6 +1217,7 @@ void WebIntentPickerViews::OnInlineDisposition(
|
|
|
| void WebIntentPickerViews::OnExtensionInstallClicked(
|
| const std::string& extension_id) {
|
| + DCHECK(delegate_);
|
| can_close_ = false;
|
| extensions_->StartThrobber(extension_id);
|
| more_suggestions_link_->SetEnabled(false);
|
| @@ -1218,11 +1228,13 @@ void WebIntentPickerViews::OnExtensionInstallClicked(
|
| void WebIntentPickerViews::OnExtensionLinkClicked(
|
| const std::string& extension_id,
|
| WindowOpenDisposition disposition) {
|
| + DCHECK(delegate_);
|
| delegate_->OnExtensionLinkClicked(extension_id, disposition);
|
| }
|
|
|
| void WebIntentPickerViews::OnActionButtonClicked(
|
| IntentRowView::ActionType type, size_t tag) {
|
| + DCHECK(delegate_);
|
| DCHECK_EQ(IntentRowView::ACTION_INVOKE, type);
|
| const WebIntentPickerModel::InstalledService& service =
|
| model_->GetInstalledServiceAt(tag);
|
|
|