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

Side by Side Diff: chrome/browser/tab_contents/web_contents.cc

Issue 19677: Clean up the Windows-ness in the sizing of new views. Write a bunch of commen... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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) 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/web_contents.h" 5 #include "chrome/browser/tab_contents/web_contents.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.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 11 matching lines...) Expand all
22 #include "chrome/browser/js_before_unload_handler.h" 22 #include "chrome/browser/js_before_unload_handler.h"
23 #include "chrome/browser/jsmessage_box_handler.h" 23 #include "chrome/browser/jsmessage_box_handler.h"
24 #include "chrome/browser/load_from_memory_cache_details.h" 24 #include "chrome/browser/load_from_memory_cache_details.h"
25 #include "chrome/browser/load_notification_details.h" 25 #include "chrome/browser/load_notification_details.h"
26 #include "chrome/browser/modal_html_dialog_delegate.h" 26 #include "chrome/browser/modal_html_dialog_delegate.h"
27 #include "chrome/browser/password_manager/password_manager.h" 27 #include "chrome/browser/password_manager/password_manager.h"
28 #include "chrome/browser/plugin_installer.h" 28 #include "chrome/browser/plugin_installer.h"
29 #include "chrome/browser/plugin_service.h" 29 #include "chrome/browser/plugin_service.h"
30 #include "chrome/browser/printing/print_job.h" 30 #include "chrome/browser/printing/print_job.h"
31 #include "chrome/browser/renderer_host/render_view_host.h" 31 #include "chrome/browser/renderer_host/render_view_host.h"
32 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" // TODO(b rettw) delete me. 32 #include "chrome/browser/renderer_host/render_widget_host_view.h"
33 #include "chrome/browser/search_engines/template_url_fetcher.h" 33 #include "chrome/browser/search_engines/template_url_fetcher.h"
34 #include "chrome/browser/search_engines/template_url_model.h" 34 #include "chrome/browser/search_engines/template_url_model.h"
35 #include "chrome/browser/tab_contents/navigation_entry.h" 35 #include "chrome/browser/tab_contents/navigation_entry.h"
36 #include "chrome/browser/tab_contents/web_contents_view.h" 36 #include "chrome/browser/tab_contents/web_contents_view.h"
37 #include "chrome/browser/tab_contents/web_contents_view_win.h" 37 #include "chrome/browser/tab_contents/web_contents_view_win.h"
38 #include "chrome/browser/views/hung_renderer_view.h" // TODO(brettw) delete me. 38 #include "chrome/browser/views/hung_renderer_view.h" // TODO(brettw) delete me.
39 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/l10n_util.h" 40 #include "chrome/common/l10n_util.h"
41 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
42 #include "chrome/common/pref_service.h" 42 #include "chrome/common/pref_service.h"
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); 1369 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
1370 } 1370 }
1371 1371
1372 void WebContents::UpdateRenderViewSizeForRenderManager() { 1372 void WebContents::UpdateRenderViewSizeForRenderManager() {
1373 // TODO(brettw) this is a hack. See WebContentsView::SizeContents. 1373 // TODO(brettw) this is a hack. See WebContentsView::SizeContents.
1374 view_->SizeContents(view_->GetContainerSize()); 1374 view_->SizeContents(view_->GetContainerSize());
1375 } 1375 }
1376 1376
1377 bool WebContents::CreateRenderViewForRenderManager( 1377 bool WebContents::CreateRenderViewForRenderManager(
1378 RenderViewHost* render_view_host) { 1378 RenderViewHost* render_view_host) {
1379 RenderWidgetHostView* rvh_view = view_->CreateViewForWidget(render_view_host); 1379 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host);
1380 if (!render_view_host->CreateRenderView())
1381 return false;
1380 1382
1381 bool ok = render_view_host->CreateRenderView(); 1383 // Now that the RenderView has been created, we need to tell it its size.
1382 if (ok) { 1384 rwh_view->SetSize(view_->GetContainerSize());
1383 // TODO(brettw) hack alert. Do this in some cross platform way, or move 1385
1384 // to the view? 1386 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(),
1385 RenderWidgetHostViewWin* rvh_view_win = 1387 render_view_host);
1386 static_cast<RenderWidgetHostViewWin*>(rvh_view); 1388 return true;
1387 rvh_view->SetSize(view_->GetContainerSize());
1388 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(),
1389 render_view_host);
1390 }
1391 return ok;
1392 } 1389 }
1393 1390
1394 void WebContents::Observe(NotificationType type, 1391 void WebContents::Observe(NotificationType type,
1395 const NotificationSource& source, 1392 const NotificationSource& source,
1396 const NotificationDetails& details) { 1393 const NotificationDetails& details) {
1397 switch (type) { 1394 switch (type) {
1398 case NOTIFY_BOOKMARK_MODEL_LOADED: // BookmarkModel finished loading, fall 1395 case NOTIFY_BOOKMARK_MODEL_LOADED: // BookmarkModel finished loading, fall
1399 // through to update starred state. 1396 // through to update starred state.
1400 case NOTIFY_URLS_STARRED: { // Somewhere, a URL has been starred. 1397 case NOTIFY_URLS_STARRED: { // Somewhere, a URL has been starred.
1401 // Ignore notifications for profiles other than our current one. 1398 // Ignore notifications for profiles other than our current one.
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 // The favicon url isn't valid. This means there really isn't a favicon, 1777 // The favicon url isn't valid. This means there really isn't a favicon,
1781 // or the favicon url wasn't obtained before the load started. This assumes 1778 // or the favicon url wasn't obtained before the load started. This assumes
1782 // the later. 1779 // the later.
1783 // TODO(sky): Need a way to set the favicon that doesn't involve generating 1780 // TODO(sky): Need a way to set the favicon that doesn't involve generating
1784 // its url. 1781 // its url.
1785 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); 1782 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer));
1786 } 1783 }
1787 new_url->set_safe_for_autoreplace(true); 1784 new_url->set_safe_for_autoreplace(true);
1788 url_model->Add(new_url); 1785 url_model->Add(new_url);
1789 } 1786 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view.h ('k') | chrome/browser/tab_contents/web_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698