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

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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 return NULL; 186 return NULL;
187 } 187 }
188 188
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 bool 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 DCHECK(disposition != CURRENT_TAB); 200 DCHECK(disposition != CURRENT_TAB);
201 201
202 // Theoretically could be called while dragging if the page tries to 202 // 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. 203 // spawn a window. Route this message back to the browser in most cases.
204 if (drag_data_->GetSourceTabData()->original_delegate_) { 204 if (drag_data_->GetSourceTabData()->original_delegate_) {
205 drag_data_->GetSourceTabData()->original_delegate_->AddNewContents( 205 return drag_data_->GetSourceTabData()->original_delegate_->AddNewContents(
206 source, new_contents, disposition, initial_pos, user_gesture); 206 source, new_contents, disposition, initial_pos, user_gesture);
207 } 207 }
208 return true;
208 } 209 }
209 210
210 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) { 211 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) {
211 // TODO(jhawkins): It would be nice to respond to this message by changing the 212 // TODO(jhawkins): It would be nice to respond to this message by changing the
212 // screen shot in the dragged tab. 213 // screen shot in the dragged tab.
213 if (dragged_view_.get()) 214 if (dragged_view_.get())
214 dragged_view_->Update(); 215 dragged_view_->Update();
215 } 216 }
216 217
217 content::JavaScriptDialogCreator* 218 content::JavaScriptDialogCreator*
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 885
885 bool DraggedTabControllerGtk::AreTabsConsecutive() { 886 bool DraggedTabControllerGtk::AreTabsConsecutive() {
886 for (size_t i = 1; i < drag_data_->size(); ++i) { 887 for (size_t i = 1; i < drag_data_->size(); ++i) {
887 if (drag_data_->get(i - 1)->source_model_index_ + 1 != 888 if (drag_data_->get(i - 1)->source_model_index_ + 1 !=
888 drag_data_->get(i)->source_model_index_) { 889 drag_data_->get(i)->source_model_index_) {
889 return false; 890 return false;
890 } 891 }
891 } 892 }
892 return true; 893 return true;
893 } 894 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698