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

Side by Side Diff: chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc

Issue 10868116: Pass result of blockage across content API when new tab blocked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/gtk/tabs/dragged_tab_controller_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 void DraggedTabControllerGtk::NavigationStateChanged(const WebContents* source, 189 void DraggedTabControllerGtk::NavigationStateChanged(const WebContents* source,
190 unsigned changed_flags) { 190 unsigned changed_flags) {
191 if (dragged_view_.get()) 191 if (dragged_view_.get())
192 dragged_view_->Update(); 192 dragged_view_->Update();
193 } 193 }
194 194
195 void DraggedTabControllerGtk::AddNewContents(WebContents* source, 195 void DraggedTabControllerGtk::AddNewContents(WebContents* source,
196 WebContents* new_contents, 196 WebContents* new_contents,
197 WindowOpenDisposition disposition, 197 WindowOpenDisposition disposition,
198 const gfx::Rect& initial_pos, 198 const gfx::Rect& initial_pos,
199 bool user_gesture) { 199 bool user_gesture,
200 bool* was_blocked) {
200 DCHECK(disposition != CURRENT_TAB); 201 DCHECK(disposition != CURRENT_TAB);
201 202
202 // Theoretically could be called while dragging if the page tries to 203 // Theoretically could be called while dragging if the page tries to
203 // spawn a window. Route this message back to the browser in most cases. 204 // spawn a window. Route this message back to the browser in most cases.
204 if (drag_data_->GetSourceTabData()->original_delegate_) { 205 if (drag_data_->GetSourceTabData()->original_delegate_) {
205 drag_data_->GetSourceTabData()->original_delegate_->AddNewContents( 206 drag_data_->GetSourceTabData()->original_delegate_->AddNewContents(
206 source, new_contents, disposition, initial_pos, user_gesture); 207 source, new_contents, disposition, initial_pos, user_gesture,
208 was_blocked);
207 } 209 }
208 } 210 }
209 211
210 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) { 212 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) {
211 // TODO(jhawkins): It would be nice to respond to this message by changing the 213 // TODO(jhawkins): It would be nice to respond to this message by changing the
212 // screen shot in the dragged tab. 214 // screen shot in the dragged tab.
213 if (dragged_view_.get()) 215 if (dragged_view_.get())
214 dragged_view_->Update(); 216 dragged_view_->Update();
215 } 217 }
216 218
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 886
885 bool DraggedTabControllerGtk::AreTabsConsecutive() { 887 bool DraggedTabControllerGtk::AreTabsConsecutive() {
886 for (size_t i = 1; i < drag_data_->size(); ++i) { 888 for (size_t i = 1; i < drag_data_->size(); ++i) {
887 if (drag_data_->get(i - 1)->source_model_index_ + 1 != 889 if (drag_data_->get(i - 1)->source_model_index_ + 1 !=
888 drag_data_->get(i)->source_model_index_) { 890 drag_data_->get(i)->source_model_index_) {
889 return false; 891 return false;
890 } 892 }
891 } 893 }
892 return true; 894 return true;
893 } 895 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698