| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index d8e4d6e21caa423232c2a17eca697dcb5679e589..5f879d15e2d7e5f6594cad85c897b743b5e10f56 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -316,7 +316,7 @@ WebContentsImpl::WebContentsImpl(
|
| maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
|
| temporary_zoom_settings_(false),
|
| content_restrictions_(0),
|
| - color_chooser_(NULL),
|
| + color_chooser_identifier_(0),
|
| message_source_(NULL),
|
| fullscreen_widget_routing_id_(MSG_ROUTING_NONE) {
|
| }
|
| @@ -1972,17 +1972,16 @@ bool WebContentsImpl::HasOpener() const {
|
| return opener_ != NULL;
|
| }
|
|
|
| -void WebContentsImpl::DidChooseColorInColorChooser(int color_chooser_id,
|
| - SkColor color) {
|
| +void WebContentsImpl::DidChooseColorInColorChooser(SkColor color) {
|
| Send(new ViewMsg_DidChooseColorResponse(
|
| - GetRoutingID(), color_chooser_id, color));
|
| + GetRoutingID(), color_chooser_identifier_, color));
|
| }
|
|
|
| -void WebContentsImpl::DidEndColorChooser(int color_chooser_id) {
|
| - Send(new ViewMsg_DidEndColorChooser(GetRoutingID(), color_chooser_id));
|
| - if (delegate_)
|
| - delegate_->DidEndColorChooser();
|
| - color_chooser_ = NULL;
|
| +void WebContentsImpl::DidEndColorChooser() {
|
| + Send(new ViewMsg_DidEndColorChooser(GetRoutingID(),
|
| + color_chooser_identifier_));
|
| + color_chooser_.reset();
|
| + color_chooser_identifier_ = 0;
|
| }
|
|
|
| int WebContentsImpl::DownloadImage(const GURL& url,
|
| @@ -2328,20 +2327,23 @@ void WebContentsImpl::OnAppCacheAccessed(const GURL& manifest_url,
|
|
|
| void WebContentsImpl::OnOpenColorChooser(int color_chooser_id,
|
| SkColor color) {
|
| - color_chooser_ = delegate_ ?
|
| - delegate_->OpenColorChooser(this, color_chooser_id, color) : NULL;
|
| + ColorChooser* new_color_chooser = delegate_->OpenColorChooser(this, color);
|
| + if (color_chooser_ == new_color_chooser)
|
| + return;
|
| + color_chooser_.reset(new_color_chooser);
|
| + color_chooser_identifier_ = color_chooser_id;
|
| }
|
|
|
| void WebContentsImpl::OnEndColorChooser(int color_chooser_id) {
|
| if (color_chooser_ &&
|
| - color_chooser_id == color_chooser_->identifier())
|
| + color_chooser_id == color_chooser_identifier_)
|
| color_chooser_->End();
|
| }
|
|
|
| void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id,
|
| SkColor color) {
|
| if (color_chooser_ &&
|
| - color_chooser_id == color_chooser_->identifier())
|
| + color_chooser_id == color_chooser_identifier_)
|
| color_chooser_->SetSelectedColor(color);
|
| }
|
|
|
|
|