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

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

Issue 7283022: Make a clean interface for dialog callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 5 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 is_showing_before_unload_dialog_ = false; 1834 is_showing_before_unload_dialog_ = false;
1835 render_view_host()->JavaScriptDialogClosed(reply_msg, 1835 render_view_host()->JavaScriptDialogClosed(reply_msg,
1836 success, 1836 success,
1837 user_input); 1837 user_input);
1838 } 1838 }
1839 1839
1840 gfx::NativeWindow TabContents::GetDialogRootWindow() { 1840 gfx::NativeWindow TabContents::GetDialogRootWindow() {
1841 return view_->GetTopLevelNativeWindow(); 1841 return view_->GetTopLevelNativeWindow();
1842 } 1842 }
1843 1843
1844 TabContents* TabContents::AsTabContents() { 1844 void TabContents::OnDialogShown() {
1845 return this; 1845 Activate();
1846 }
1847
1848 ExtensionHost* TabContents::AsExtensionHost() {
1849 return NULL;
1850 } 1846 }
1851 1847
1852 void TabContents::set_encoding(const std::string& encoding) { 1848 void TabContents::set_encoding(const std::string& encoding) {
1853 encoding_ = content::GetContentClient()->browser()-> 1849 encoding_ = content::GetContentClient()->browser()->
1854 GetCanonicalEncodingNameByAliasName(encoding); 1850 GetCanonicalEncodingNameByAliasName(encoding);
1855 } 1851 }
1856 1852
1857 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { 1853 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) {
1858 render_manager_.SwapInRenderViewHost(rvh); 1854 render_manager_.SwapInRenderViewHost(rvh);
1859 } 1855 }
1860 1856
1861 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 1857 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
1862 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 1858 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
1863 rwh_view->SetSize(view()->GetContainerSize()); 1859 rwh_view->SetSize(view()->GetContainerSize());
1864 } 1860 }
1865 1861
1866 void TabContents::OnOnlineStateChanged(bool online) { 1862 void TabContents::OnOnlineStateChanged(bool online) {
1867 render_view_host()->Send(new ViewMsg_NetworkStateChanged( 1863 render_view_host()->Send(new ViewMsg_NetworkStateChanged(
1868 render_view_host()->routing_id(), online)); 1864 render_view_host()->routing_id(), online));
1869 } 1865 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698