| 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| 11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
| 14 #include "chrome/browser/dom_operation_notification_details.h" | 14 #include "chrome/browser/dom_operation_notification_details.h" |
| 15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
| 16 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 17 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 17 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 18 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 18 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 19 #include "chrome/browser/renderer_host/site_instance.h" | 19 #include "chrome/browser/renderer_host/site_instance.h" |
| 20 #include "chrome/browser/tab_contents/navigation_controller.h" | 20 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 21 #include "chrome/browser/tab_contents/navigation_entry.h" | 21 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 22 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents_view.h" | 23 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 24 #include "chrome/common/bindings_policy.h" | 24 #include "chrome/common/bindings_policy.h" |
| 25 #if defined(TOOLKIT_GTK) | 25 #if defined(TOOLKIT_GTK) |
| 26 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 26 #include "chrome/common/gtk_util.h" | 27 #include "chrome/common/gtk_util.h" |
| 27 #endif | 28 #endif |
| 28 #include "chrome/common/notification_service.h" | 29 #include "chrome/common/notification_service.h" |
| 29 #include "grit/browser_resources.h" | 30 #include "grit/browser_resources.h" |
| 30 #include "net/base/escape.h" | 31 #include "net/base/escape.h" |
| 31 #include "views/window/window_delegate.h" | 32 #include "views/window/window_delegate.h" |
| 32 | 33 |
| 33 using WebKit::WebDragOperation; | 34 using WebKit::WebDragOperation; |
| 34 using WebKit::WebDragOperationsMask; | 35 using WebKit::WebDragOperationsMask; |
| 35 | 36 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( | 137 ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( |
| 137 new InterstitialPageRVHViewDelegate(this))) { | 138 new InterstitialPageRVHViewDelegate(this))) { |
| 138 InitInterstitialPageMap(); | 139 InitInterstitialPageMap(); |
| 139 // It would be inconsistent to create an interstitial with no new navigation | 140 // It would be inconsistent to create an interstitial with no new navigation |
| 140 // (which is the case when the interstitial was triggered by a sub-resource on | 141 // (which is the case when the interstitial was triggered by a sub-resource on |
| 141 // a page) when we have a pending entry (in the process of loading a new top | 142 // a page) when we have a pending entry (in the process of loading a new top |
| 142 // frame). | 143 // frame). |
| 143 DCHECK(new_navigation || !tab->controller().pending_entry()); | 144 DCHECK(new_navigation || !tab->controller().pending_entry()); |
| 144 | 145 |
| 145 #if defined(TOOLKIT_GTK) | 146 #if defined(TOOLKIT_GTK) |
| 146 gtk_util::InitRendererPrefsFromGtkSettings(&renderer_preferences_); | 147 gtk_util::InitRendererPrefsFromGtkSettings(&renderer_preferences_, |
| 148 GtkThemeProvider::GetFrom(tab->profile())->UseGtkTheme()); |
| 147 #endif | 149 #endif |
| 148 } | 150 } |
| 149 | 151 |
| 150 InterstitialPage::~InterstitialPage() { | 152 InterstitialPage::~InterstitialPage() { |
| 151 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); | 153 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); |
| 152 DCHECK(iter != tab_to_interstitial_page_->end()) << | 154 DCHECK(iter != tab_to_interstitial_page_->end()) << |
| 153 "InterstitialPage missing from map. Please add a comment to the bug " | 155 "InterstitialPage missing from map. Please add a comment to the bug " |
| 154 "http://crbug.com/9442 with the URL you were visiting"; | 156 "http://crbug.com/9442 with the URL you were visiting"; |
| 155 if (iter != tab_to_interstitial_page_->end()) | 157 if (iter != tab_to_interstitial_page_->end()) |
| 156 tab_to_interstitial_page_->erase(iter); | 158 tab_to_interstitial_page_->erase(iter); |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 } | 612 } |
| 611 | 613 |
| 612 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 614 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
| 613 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 615 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
| 614 int active_match_ordinal, bool final_update) { | 616 int active_match_ordinal, bool final_update) { |
| 615 } | 617 } |
| 616 | 618 |
| 617 int InterstitialPage::GetBrowserWindowID() const { | 619 int InterstitialPage::GetBrowserWindowID() const { |
| 618 return tab_->GetBrowserWindowID(); | 620 return tab_->GetBrowserWindowID(); |
| 619 } | 621 } |
| OLD | NEW |