OLD | NEW |
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" |
11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
12 #include "chrome/browser/platform_util.h" | 12 #include "chrome/browser/platform_util.h" |
13 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_creator.h" | 13 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
16 #include "chrome/browser/ui/gtk/gtk_util.h" | 16 #include "chrome/browser/ui/gtk/gtk_util.h" |
17 #include "chrome/browser/ui/gtk/tabs/dragged_view_gtk.h" | 17 #include "chrome/browser/ui/gtk/tabs/dragged_view_gtk.h" |
18 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 18 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) { | 209 void DraggedTabControllerGtk::LoadingStateChanged(WebContents* source) { |
210 // TODO(jhawkins): It would be nice to respond to this message by changing the | 210 // TODO(jhawkins): It would be nice to respond to this message by changing the |
211 // screen shot in the dragged tab. | 211 // screen shot in the dragged tab. |
212 if (dragged_view_.get()) | 212 if (dragged_view_.get()) |
213 dragged_view_->Update(); | 213 dragged_view_->Update(); |
214 } | 214 } |
215 | 215 |
216 content::JavaScriptDialogCreator* | 216 content::JavaScriptDialogManager* |
217 DraggedTabControllerGtk::GetJavaScriptDialogCreator() { | 217 DraggedTabControllerGtk::GetJavaScriptDialogManager() { |
218 return GetJavaScriptDialogCreatorInstance(); | 218 return GetJavaScriptDialogManagerInstance(); |
219 } | 219 } |
220 | 220 |
221 //////////////////////////////////////////////////////////////////////////////// | 221 //////////////////////////////////////////////////////////////////////////////// |
222 // DraggedTabControllerGtk, content::NotificationObserver implementation: | 222 // DraggedTabControllerGtk, content::NotificationObserver implementation: |
223 | 223 |
224 void DraggedTabControllerGtk::Observe( | 224 void DraggedTabControllerGtk::Observe( |
225 int type, | 225 int type, |
226 const content::NotificationSource& source, | 226 const content::NotificationSource& source, |
227 const content::NotificationDetails& details) { | 227 const content::NotificationDetails& details) { |
228 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); | 228 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 | 881 |
882 bool DraggedTabControllerGtk::AreTabsConsecutive() { | 882 bool DraggedTabControllerGtk::AreTabsConsecutive() { |
883 for (size_t i = 1; i < drag_data_->size(); ++i) { | 883 for (size_t i = 1; i < drag_data_->size(); ++i) { |
884 if (drag_data_->get(i - 1)->source_model_index_ + 1 != | 884 if (drag_data_->get(i - 1)->source_model_index_ + 1 != |
885 drag_data_->get(i)->source_model_index_) { | 885 drag_data_->get(i)->source_model_index_) { |
886 return false; | 886 return false; |
887 } | 887 } |
888 } | 888 } |
889 return true; | 889 return true; |
890 } | 890 } |
OLD | NEW |