| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 if (!render_manager_.dom_ui()) { | 1834 if (!render_manager_.dom_ui()) { |
| 1835 // We shouldn't get a DOM UI message when we haven't enabled the DOM UI. | 1835 // We shouldn't get a DOM UI message when we haven't enabled the DOM UI. |
| 1836 // Because the renderer might be owned and sending random messages, we need | 1836 // Because the renderer might be owned and sending random messages, we need |
| 1837 // to ignore these inproper ones. | 1837 // to ignore these inproper ones. |
| 1838 NOTREACHED(); | 1838 NOTREACHED(); |
| 1839 return; | 1839 return; |
| 1840 } | 1840 } |
| 1841 render_manager_.dom_ui()->ProcessDOMUIMessage(message, content); | 1841 render_manager_.dom_ui()->ProcessDOMUIMessage(message, content); |
| 1842 } | 1842 } |
| 1843 | 1843 |
| 1844 void TabContents::DocumentLoadedInFrame() { |
| 1845 controller_.DocumentLoadedInFrame(); |
| 1846 } |
| 1847 |
| 1844 void TabContents::ProcessExternalHostMessage(const std::string& message, | 1848 void TabContents::ProcessExternalHostMessage(const std::string& message, |
| 1845 const std::string& origin, | 1849 const std::string& origin, |
| 1846 const std::string& target) { | 1850 const std::string& target) { |
| 1847 if (delegate()) | 1851 if (delegate()) |
| 1848 delegate()->ForwardMessageToExternalHost(message, origin, target); | 1852 delegate()->ForwardMessageToExternalHost(message, origin, target); |
| 1849 } | 1853 } |
| 1850 | 1854 |
| 1851 void TabContents::GoToEntryAtOffset(int offset) { | 1855 void TabContents::GoToEntryAtOffset(int offset) { |
| 1852 controller_.GoToOffset(offset); | 1856 controller_.GoToOffset(offset); |
| 1853 } | 1857 } |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 &GearsCreateShortcutCallbackFunctor::Run)); | 2174 &GearsCreateShortcutCallbackFunctor::Run)); |
| 2171 } | 2175 } |
| 2172 | 2176 |
| 2173 void TabContents::OnUserGesture() { | 2177 void TabContents::OnUserGesture() { |
| 2174 // See comment in RenderViewHostDelegate::OnUserGesture as to why we do this. | 2178 // See comment in RenderViewHostDelegate::OnUserGesture as to why we do this. |
| 2175 #if defined(OS_WIN) || defined(OS_LINUX) | 2179 #if defined(OS_WIN) || defined(OS_LINUX) |
| 2176 DownloadRequestManager* drm = g_browser_process->download_request_manager(); | 2180 DownloadRequestManager* drm = g_browser_process->download_request_manager(); |
| 2177 if (drm) | 2181 if (drm) |
| 2178 drm->OnUserGesture(this); | 2182 drm->OnUserGesture(this); |
| 2179 #endif | 2183 #endif |
| 2184 controller_.OnUserGesture(); |
| 2180 } | 2185 } |
| 2181 | 2186 |
| 2182 void TabContents::OnFindReply(int request_id, | 2187 void TabContents::OnFindReply(int request_id, |
| 2183 int number_of_matches, | 2188 int number_of_matches, |
| 2184 const gfx::Rect& selection_rect, | 2189 const gfx::Rect& selection_rect, |
| 2185 int active_match_ordinal, | 2190 int active_match_ordinal, |
| 2186 bool final_update) { | 2191 bool final_update) { |
| 2187 // Ignore responses for requests other than the one we have most recently | 2192 // Ignore responses for requests other than the one we have most recently |
| 2188 // issued. That way we won't act on stale results when the user has | 2193 // issued. That way we won't act on stale results when the user has |
| 2189 // already typed in another query. | 2194 // already typed in another query. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 NavigationController::LoadCommittedDetails& committed_details = | 2324 NavigationController::LoadCommittedDetails& committed_details = |
| 2320 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2325 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2321 ExpireInfoBars(committed_details); | 2326 ExpireInfoBars(committed_details); |
| 2322 break; | 2327 break; |
| 2323 } | 2328 } |
| 2324 | 2329 |
| 2325 default: | 2330 default: |
| 2326 NOTREACHED(); | 2331 NOTREACHED(); |
| 2327 } | 2332 } |
| 2328 } | 2333 } |
| OLD | NEW |