| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/interstitial_page.h" | 5 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/thread.h" | 9 #include "base/thread.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/dom_operation_notification_details.h" | 12 #include "chrome/browser/dom_operation_notification_details.h" |
| 13 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 13 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 14 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 14 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 15 #include "chrome/browser/tab_contents/navigation_controller.h" | 15 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 16 #include "chrome/browser/tab_contents/navigation_entry.h" | 16 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents.h" | 17 #include "chrome/browser/tab_contents/tab_contents.h" |
| 18 #include "chrome/browser/tab_contents/tab_contents_view.h" | 18 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 19 #include "chrome/common/bindings_policy.h" | 19 #include "chrome/common/bindings_policy.h" |
| 20 #if defined(TOOLKIT_GTK) | 20 #if defined(TOOLKIT_GTK) |
| 21 #include "chrome/common/gtk_util.h" | 21 #include "chrome/common/gtk_util.h" |
| 22 #endif | 22 #endif |
| 23 #include "chrome/common/notification_service.h" | 23 #include "chrome/common/notification_service.h" |
| 24 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 25 #include "net/base/escape.h" | 25 #include "net/base/escape.h" |
| 26 #include "views/window/window_delegate.h" | 26 #include "views/window/window_delegate.h" |
| 27 | 27 |
| 28 using WebKit::WebDragOperation; |
| 29 using WebKit::WebDragOperationsMask; |
| 30 |
| 28 namespace { | 31 namespace { |
| 29 | 32 |
| 30 class ResourceRequestTask : public Task { | 33 class ResourceRequestTask : public Task { |
| 31 public: | 34 public: |
| 32 ResourceRequestTask(int process_id, | 35 ResourceRequestTask(int process_id, |
| 33 int render_view_host_id, | 36 int render_view_host_id, |
| 34 ResourceRequestAction action) | 37 ResourceRequestAction action) |
| 35 : action_(action), | 38 : action_(action), |
| 36 process_id_(process_id), | 39 process_id_(process_id), |
| 37 render_view_host_id_(render_view_host_id), | 40 render_view_host_id_(render_view_host_id), |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 base::WaitableEvent* modal_dialog_event); | 82 base::WaitableEvent* modal_dialog_event); |
| 80 virtual void CreateNewWidget(int route_id, bool activatable); | 83 virtual void CreateNewWidget(int route_id, bool activatable); |
| 81 virtual void ShowCreatedWindow(int route_id, | 84 virtual void ShowCreatedWindow(int route_id, |
| 82 WindowOpenDisposition disposition, | 85 WindowOpenDisposition disposition, |
| 83 const gfx::Rect& initial_pos, | 86 const gfx::Rect& initial_pos, |
| 84 bool user_gesture, | 87 bool user_gesture, |
| 85 const GURL& creator_url); | 88 const GURL& creator_url); |
| 86 virtual void ShowCreatedWidget(int route_id, | 89 virtual void ShowCreatedWidget(int route_id, |
| 87 const gfx::Rect& initial_pos); | 90 const gfx::Rect& initial_pos); |
| 88 virtual void ShowContextMenu(const ContextMenuParams& params); | 91 virtual void ShowContextMenu(const ContextMenuParams& params); |
| 89 virtual void StartDragging(const WebDropData& drop_data); | 92 virtual void StartDragging(const WebDropData& drop_data, |
| 90 virtual void UpdateDragCursor(bool is_drop_target); | 93 WebDragOperationsMask operations_allowed); |
| 94 virtual void UpdateDragCursor(WebDragOperation operation); |
| 91 virtual void GotFocus(); | 95 virtual void GotFocus(); |
| 92 virtual void TakeFocus(bool reverse); | 96 virtual void TakeFocus(bool reverse); |
| 93 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 97 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 94 virtual void HandleMouseEvent(); | 98 virtual void HandleMouseEvent(); |
| 95 virtual void HandleMouseLeave(); | 99 virtual void HandleMouseLeave(); |
| 96 virtual void OnFindReply(int request_id, | 100 virtual void OnFindReply(int request_id, |
| 97 int number_of_matches, | 101 int number_of_matches, |
| 98 const gfx::Rect& selection_rect, | 102 const gfx::Rect& selection_rect, |
| 99 int active_match_ordinal, | 103 int active_match_ordinal, |
| 100 bool final_update); | 104 bool final_update); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 void InterstitialPage::InterstitialPageRVHViewDelegate::ShowCreatedWidget( | 546 void InterstitialPage::InterstitialPageRVHViewDelegate::ShowCreatedWidget( |
| 543 int route_id, const gfx::Rect& initial_pos) { | 547 int route_id, const gfx::Rect& initial_pos) { |
| 544 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; | 548 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; |
| 545 } | 549 } |
| 546 | 550 |
| 547 void InterstitialPage::InterstitialPageRVHViewDelegate::ShowContextMenu( | 551 void InterstitialPage::InterstitialPageRVHViewDelegate::ShowContextMenu( |
| 548 const ContextMenuParams& params) { | 552 const ContextMenuParams& params) { |
| 549 } | 553 } |
| 550 | 554 |
| 551 void InterstitialPage::InterstitialPageRVHViewDelegate::StartDragging( | 555 void InterstitialPage::InterstitialPageRVHViewDelegate::StartDragging( |
| 552 const WebDropData& drop_data) { | 556 const WebDropData& drop_data, |
| 557 WebDragOperationsMask allowed_operations) { |
| 553 NOTREACHED() << "InterstitialPage does not support dragging yet."; | 558 NOTREACHED() << "InterstitialPage does not support dragging yet."; |
| 554 } | 559 } |
| 555 | 560 |
| 556 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdateDragCursor( | 561 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdateDragCursor( |
| 557 bool is_drop_target) { | 562 WebDragOperation) { |
| 558 NOTREACHED() << "InterstitialPage does not support dragging yet."; | 563 NOTREACHED() << "InterstitialPage does not support dragging yet."; |
| 559 } | 564 } |
| 560 | 565 |
| 561 void InterstitialPage::InterstitialPageRVHViewDelegate::GotFocus() { | 566 void InterstitialPage::InterstitialPageRVHViewDelegate::GotFocus() { |
| 562 } | 567 } |
| 563 | 568 |
| 564 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredWidth( | 569 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredWidth( |
| 565 int pref_width) { | 570 int pref_width) { |
| 566 } | 571 } |
| 567 | 572 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 588 } | 593 } |
| 589 | 594 |
| 590 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 595 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
| 591 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 596 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
| 592 int active_match_ordinal, bool final_update) { | 597 int active_match_ordinal, bool final_update) { |
| 593 } | 598 } |
| 594 | 599 |
| 595 int InterstitialPage::GetBrowserWindowID() const { | 600 int InterstitialPage::GetBrowserWindowID() const { |
| 596 return tab_->GetBrowserWindowID(); | 601 return tab_->GetBrowserWindowID(); |
| 597 } | 602 } |
| OLD | NEW |