summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-10 18:23:44 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-10 18:23:44 +0000
commit7a2c14224b1e53691c2846a0f84cb5f5fcabfc69 (patch)
tree2739ae86e9b52875014133fb81d5e6e18ec4fed4 /chrome/browser/tab_contents
parent7db46a1fd14a4f3e2e16a7b913e44c471f354ee1 (diff)
downloadchromium_src-7a2c14224b1e53691c2846a0f84cb5f5fcabfc69.zip
chromium_src-7a2c14224b1e53691c2846a0f84cb5f5fcabfc69.tar.gz
chromium_src-7a2c14224b1e53691c2846a0f84cb5f5fcabfc69.tar.bz2
Try reverting r9409 to see if it fixes crashes on chromebot.
TBR=avi Review URL: http://codereview.chromium.org/21215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc4
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_controller.cc25
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc28
-rw-r--r--chrome/browser/tab_contents/tab_contents.h11
-rw-r--r--chrome/browser/tab_contents/web_contents.cc8
-rw-r--r--chrome/browser/tab_contents/web_contents.h6
6 files changed, 40 insertions, 42 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index 9685a4f..fbc464a 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -216,8 +216,8 @@ RenderViewHost* InterstitialPage::CreateRenderViewHost() {
RenderWidgetHostViewWin* view =
new RenderWidgetHostViewWin(render_view_host);
render_view_host->set_view(view);
- view->Create(tab_->GetContentNativeView());
- view->set_parent_hwnd(tab_->GetContentNativeView());
+ view->Create(tab_->GetContentHWND());
+ view->set_parent_hwnd(tab_->GetContentHWND());
WebContentsViewWin* web_contents_view =
static_cast<WebContentsViewWin*>(tab_->view());
render_view_host->CreateRenderView();
diff --git a/chrome/browser/tab_contents/render_view_context_menu_controller.cc b/chrome/browser/tab_contents/render_view_context_menu_controller.cc
index d1fdc46..7a43ff3 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_controller.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu_controller.cc
@@ -345,11 +345,10 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
case IDS_CONTENT_CONTEXT_VIEWPAGEINFO: {
NavigationEntry* nav_entry =
source_web_contents_->controller()->GetActiveEntry();
- PageInfoWindow::CreatePageInfo(
- source_web_contents_->profile(),
- nav_entry,
- source_web_contents_->GetContentNativeView(),
- PageInfoWindow::SECURITY);
+ PageInfoWindow::CreatePageInfo(source_web_contents_->profile(),
+ nav_entry,
+ source_web_contents_->GetContentHWND(),
+ PageInfoWindow::SECURITY);
break;
}
@@ -393,12 +392,11 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
ssl.set_cert_status(cert_status);
ssl.set_security_bits(security_bits);
}
- PageInfoWindow::CreateFrameInfo(
- source_web_contents_->profile(),
- params_.frame_url,
- ssl,
- source_web_contents_->GetContentNativeView(),
- PageInfoWindow::SECURITY);
+ PageInfoWindow::CreateFrameInfo(source_web_contents_->profile(),
+ params_.frame_url,
+ ssl,
+ source_web_contents_->GetContentHWND(),
+ PageInfoWindow::SECURITY);
break;
}
@@ -463,9 +461,8 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS: {
FontsLanguagesWindowView* window_ = new FontsLanguagesWindowView(
source_web_contents_->profile());
- views::Window::CreateChromeWindow(
- source_web_contents_->GetContentNativeView(),
- gfx::Rect(), window_)->Show();
+ views::Window::CreateChromeWindow(source_web_contents_->GetContentHWND(),
+ gfx::Rect(), window_)->Show();
window_->SelectLanguagesTab();
break;
}
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index a6287bc..6db2c86 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -106,8 +106,8 @@ void TabContents::Destroy() {
// If we still have a window handle, destroy it. GetContainerHWND can return
// NULL if this contents was part of a window that closed.
- if (GetNativeView())
- ::DestroyWindow(GetNativeView());
+ if (GetContainerHWND())
+ ::DestroyWindow(GetContainerHWND());
// Notify our NavigationController. Make sure we are deleted first, so
// that the controller is the last to die.
@@ -244,7 +244,7 @@ void TabContents::DidBecomeSelected() {
controller_->SetActive(true);
// Invalidate all descendants. (take care to exclude invalidating ourselves!)
- EnumChildWindows(GetNativeView(), InvalidateWindow, 0);
+ EnumChildWindows(GetContainerHWND(), InvalidateWindow, 0);
}
void TabContents::WasHidden() {
@@ -311,7 +311,7 @@ void TabContents::AddConstrainedPopup(TabContents* new_contents,
const gfx::Rect& initial_pos) {
if (!blocked_popups_) {
CRect client_rect;
- GetClientRect(GetNativeView(), &client_rect);
+ GetClientRect(GetContainerHWND(), &client_rect);
gfx::Point anchor_position(
client_rect.Width() -
views::NativeScrollBar::GetVerticalScrollBarWidth(),
@@ -332,7 +332,7 @@ void TabContents::CloseAllSuppressedPopups() {
}
void TabContents::Focus() {
- HWND container_hwnd = GetNativeView();
+ HWND container_hwnd = GetContainerHWND();
if (!container_hwnd)
return;
@@ -353,7 +353,7 @@ void TabContents::StoreFocus() {
view_storage->RemoveView(last_focused_view_storage_id_);
views::FocusManager* focus_manager =
- views::FocusManager::GetFocusManager(GetNativeView());
+ views::FocusManager::GetFocusManager(GetContainerHWND());
if (focus_manager) {
// |focus_manager| can be NULL if the tab has been detached but still
// exists.
@@ -364,7 +364,7 @@ void TabContents::StoreFocus() {
// If the focus was on the page, explicitly clear the focus so that we
// don't end up with the focused HWND not part of the window hierarchy.
// TODO(brettw) this should move to the view somehow.
- HWND container_hwnd = GetNativeView();
+ HWND container_hwnd = GetContainerHWND();
if (container_hwnd) {
views::View* focused_view = focus_manager->GetFocusedView();
if (focused_view) {
@@ -386,7 +386,7 @@ void TabContents::RestoreFocus() {
SetInitialFocus();
} else {
views::FocusManager* focus_manager =
- views::FocusManager::GetFocusManager(GetNativeView());
+ views::FocusManager::GetFocusManager(GetContainerHWND());
// If you hit this DCHECK, please report it to Jay (jcampan).
DCHECK(focus_manager != NULL) << "No focus manager when restoring focus.";
@@ -404,7 +404,7 @@ void TabContents::RestoreFocus() {
}
void TabContents::SetInitialFocus() {
- ::SetFocus(GetNativeView());
+ ::SetFocus(GetContainerHWND());
}
void TabContents::AddInfoBar(InfoBarDelegate* delegate) {
@@ -489,8 +489,8 @@ void TabContents::OnStartDownload(DownloadItem* download) {
// This animation will delete itself when it finishes, or if we become hidden
// or destroyed.
- if (IsWindowVisible(GetNativeView())) { // For minimized windows, unit
- // tests, etc.
+ if (IsWindowVisible(GetContainerHWND())) { // For minimized windows, unit
+ // tests, etc.
new DownloadStartedAnimation(tab_contents);
}
}
@@ -519,16 +519,16 @@ void TabContents::WillClose(ConstrainedWindow* window) {
if (window == blocked_popups_)
blocked_popups_ = NULL;
- if (::IsWindow(GetNativeView())) {
+ if (::IsWindow(GetContainerHWND())) {
CRect client_rect;
- GetClientRect(GetNativeView(), &client_rect);
+ GetClientRect(GetContainerHWND(), &client_rect);
RepositionSupressedPopupsToFit(
gfx::Size(client_rect.Width(), client_rect.Height()));
}
}
void TabContents::DidMoveOrResize(ConstrainedWindow* window) {
- UpdateWindow(GetNativeView());
+ UpdateWindow(GetContainerHWND());
}
void TabContents::Observe(NotificationType type,
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index cf6b1ab..e3cb28d 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "base/gfx/native_widget_types.h"
#include "base/gfx/rect.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/tab_contents/constrained_window.h"
@@ -344,17 +343,17 @@ class TabContents : public PageNavigator,
// Views and focus -----------------------------------------------------------
// Returns the actual window that is focused when this TabContents is shown.
- virtual gfx::NativeView GetContentNativeView() {
- return GetNativeView();
+ virtual HWND GetContentHWND() {
+ return GetContainerHWND();
}
// Tell the subclass to set up the view (e.g. create the container HWND if
// applicable) and any other create-time setup.
virtual void CreateView() {}
- // Returns the NativeView associated with this TabContents. Outside of
- // automation in the context of the UI, this is required to be implemented.
- virtual gfx::NativeView GetNativeView() const { return NULL; }
+ // Returns the HWND associated with this TabContents. Outside of automation
+ // in the context of the UI, this is required to be implemented.
+ virtual HWND GetContainerHWND() const { return NULL; }
// Returns the bounds of this TabContents in the screen coordinate system.
virtual void GetContainerBounds(gfx::Rect *out) const {
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 1670493..ec55a6c 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -499,17 +499,17 @@ void WebContents::CreateView() {
view_->CreateView();
}
-gfx::NativeView WebContents::GetNativeView() const {
+#if defined(OS_WIN)
+HWND WebContents::GetContainerHWND() const {
return view_->GetNativeView();
}
-
-gfx::NativeView WebContents::GetContentNativeView() {
+HWND WebContents::GetContentHWND() {
return view_->GetContentNativeView();
}
-
void WebContents::GetContainerBounds(gfx::Rect *out) const {
view_->GetContainerBounds(out);
}
+#endif
void WebContents::CreateShortcut() {
NavigationEntry* entry = controller()->GetLastCommittedEntry();
diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h
index 7bb858c..3326cb1 100644
--- a/chrome/browser/tab_contents/web_contents.h
+++ b/chrome/browser/tab_contents/web_contents.h
@@ -132,9 +132,11 @@ class WebContents : public TabContents,
// TODO(brettw) fix this, tab contents shouldn't have these methods, probably
// it should be killed altogether.
virtual void CreateView();
- virtual gfx::NativeView GetNativeView() const;
- virtual gfx::NativeView GetContentNativeView();
+#if defined(OS_WIN)
+ virtual HWND GetContainerHWND() const;
+ virtual HWND GetContentHWND();
virtual void GetContainerBounds(gfx::Rect *out) const;
+#endif
// Web apps ------------------------------------------------------------------