Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 6724014: Moves instant related tab contents messages into instant and out of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 OnUpdateContentRestrictions) 424 OnUpdateContentRestrictions)
425 IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature, 425 IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature,
426 OnPDFHasUnsupportedFeature) 426 OnPDFHasUnsupportedFeature)
427 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) 427 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
428 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo, 428 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo,
429 OnDidGetApplicationInfo) 429 OnDidGetApplicationInfo)
430 IPC_MESSAGE_HANDLER(ViewHostMsg_InstallApplication, 430 IPC_MESSAGE_HANDLER(ViewHostMsg_InstallApplication,
431 OnInstallApplication) 431 OnInstallApplication)
432 IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents) 432 IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents)
433 IPC_MESSAGE_HANDLER(ViewHostMsg_PageTranslated, OnPageTranslated) 433 IPC_MESSAGE_HANDLER(ViewHostMsg_PageTranslated, OnPageTranslated)
434 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSuggestions, OnSetSuggestions)
435 IPC_MESSAGE_HANDLER(ViewHostMsg_InstantSupportDetermined,
436 OnInstantSupportDetermined)
437 IPC_MESSAGE_UNHANDLED(handled = false) 434 IPC_MESSAGE_UNHANDLED(handled = false)
438 IPC_END_MESSAGE_MAP_EX() 435 IPC_END_MESSAGE_MAP_EX()
439 436
440 if (!message_is_ok) { 437 if (!message_is_ok) {
441 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); 438 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD"));
442 GetRenderProcessHost()->ReceivedBadMessage(); 439 GetRenderProcessHost()->ReceivedBadMessage();
443 } 440 }
444 441
445 return handled; 442 return handled;
446 } 443 }
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 TranslateErrors::Type error_type) { 1948 TranslateErrors::Type error_type) {
1952 language_state_.set_current_language(translated_lang); 1949 language_state_.set_current_language(translated_lang);
1953 language_state_.set_translation_pending(false); 1950 language_state_.set_translation_pending(false);
1954 PageTranslatedDetails details(original_lang, translated_lang, error_type); 1951 PageTranslatedDetails details(original_lang, translated_lang, error_type);
1955 NotificationService::current()->Notify( 1952 NotificationService::current()->Notify(
1956 NotificationType::PAGE_TRANSLATED, 1953 NotificationType::PAGE_TRANSLATED,
1957 Source<TabContents>(this), 1954 Source<TabContents>(this),
1958 Details<PageTranslatedDetails>(&details)); 1955 Details<PageTranslatedDetails>(&details));
1959 } 1956 }
1960 1957
1961 void TabContents::OnSetSuggestions(
1962 int32 page_id,
1963 const std::vector<std::string>& suggestions,
1964 InstantCompleteBehavior behavior) {
1965 if (delegate())
1966 delegate()->OnSetSuggestions(page_id, suggestions, behavior);
1967 }
1968
1969 void TabContents::OnInstantSupportDetermined(int32 page_id, bool result) {
1970 if (delegate())
1971 delegate()->OnInstantSupportDetermined(page_id, result);
1972 }
1973
1974 void TabContents::OnContentSettingsAccessed(bool content_was_blocked) { 1958 void TabContents::OnContentSettingsAccessed(bool content_was_blocked) {
1975 if (delegate_) 1959 if (delegate_)
1976 delegate_->OnContentSettingsChange(this); 1960 delegate_->OnContentSettingsChange(this);
1977 } 1961 }
1978 1962
1979 RenderViewHostDelegate::View* TabContents::GetViewDelegate() { 1963 RenderViewHostDelegate::View* TabContents::GetViewDelegate() {
1980 return view_.get(); 1964 return view_.get();
1981 } 1965 }
1982 1966
1983 RenderViewHostDelegate::RendererManagement* 1967 RenderViewHostDelegate::RendererManagement*
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2813 2797
2814 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2798 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2815 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2799 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2816 rwh_view->SetSize(view()->GetContainerSize()); 2800 rwh_view->SetSize(view()->GetContainerSize());
2817 } 2801 }
2818 2802
2819 void TabContents::OnOnlineStateChanged(bool online) { 2803 void TabContents::OnOnlineStateChanged(bool online) {
2820 render_view_host()->Send(new ViewMsg_NetworkStateChanged( 2804 render_view_host()->Send(new ViewMsg_NetworkStateChanged(
2821 render_view_host()->routing_id(), online)); 2805 render_view_host()->routing_id(), online));
2822 } 2806 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698