OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback_old.h" | 9 #include "base/callback_old.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "chrome/browser/platform_util.h" | 11 #include "chrome/browser/platform_util.h" |
12 #include "chrome/browser/tabs/tab_strip_model.h" | 12 #include "chrome/browser/tabs/tab_strip_model.h" |
| 13 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
15 #include "chrome/browser/ui/gtk/gtk_util.h" | 16 #include "chrome/browser/ui/gtk/gtk_util.h" |
16 #include "chrome/browser/ui/gtk/tabs/dragged_tab_gtk.h" | 17 #include "chrome/browser/ui/gtk/tabs/dragged_tab_gtk.h" |
17 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 18 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
19 #include "content/browser/tab_contents/tab_contents.h" | 20 #include "content/browser/tab_contents/tab_contents.h" |
20 #include "content/common/notification_source.h" | 21 #include "content/common/notification_source.h" |
21 | 22 |
22 namespace { | 23 namespace { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 174 |
174 bool DraggedTabControllerGtk::IsPopup(const TabContents* source) const { | 175 bool DraggedTabControllerGtk::IsPopup(const TabContents* source) const { |
175 return false; | 176 return false; |
176 } | 177 } |
177 | 178 |
178 void DraggedTabControllerGtk::UpdateTargetURL(TabContents* source, | 179 void DraggedTabControllerGtk::UpdateTargetURL(TabContents* source, |
179 const GURL& url) { | 180 const GURL& url) { |
180 // Ignored. | 181 // Ignored. |
181 } | 182 } |
182 | 183 |
| 184 content::JavaScriptDialogCreator* |
| 185 DraggedTabControllerGtk::GetJavaScriptDialogCreator() { |
| 186 return GetJavaScriptDialogCreatorInstance(); |
| 187 } |
| 188 |
183 //////////////////////////////////////////////////////////////////////////////// | 189 //////////////////////////////////////////////////////////////////////////////// |
184 // DraggedTabControllerGtk, NotificationObserver implementation: | 190 // DraggedTabControllerGtk, NotificationObserver implementation: |
185 | 191 |
186 void DraggedTabControllerGtk::Observe(NotificationType type, | 192 void DraggedTabControllerGtk::Observe(NotificationType type, |
187 const NotificationSource& source, | 193 const NotificationSource& source, |
188 const NotificationDetails& details) { | 194 const NotificationDetails& details) { |
189 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 195 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
190 DCHECK_EQ(Source<TabContents>(source).ptr(), | 196 DCHECK_EQ(Source<TabContents>(source).ptr(), |
191 dragged_contents_->tab_contents()); | 197 dragged_contents_->tab_contents()); |
192 EndDragImpl(TAB_DESTROYED); | 198 EndDragImpl(TAB_DESTROYED); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 gfx::NativeView dragged_tab = dragged_tab_->widget(); | 785 gfx::NativeView dragged_tab = dragged_tab_->widget(); |
780 dock_windows_.insert(dragged_tab); | 786 dock_windows_.insert(dragged_tab); |
781 window = DockInfo::GetLocalProcessWindowAtPoint(GetCursorScreenPoint(), | 787 window = DockInfo::GetLocalProcessWindowAtPoint(GetCursorScreenPoint(), |
782 dock_windows_); | 788 dock_windows_); |
783 dock_windows_.erase(dragged_tab); | 789 dock_windows_.erase(dragged_tab); |
784 } | 790 } |
785 | 791 |
786 if (window) | 792 if (window) |
787 gtk_window_present(GTK_WINDOW(window)); | 793 gtk_window_present(GTK_WINDOW(window)); |
788 } | 794 } |
OLD | NEW |