summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-06 18:32:43 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-06 18:32:43 +0000
commit46d04faeb3289f2362255b942c1c0613025b86b9 (patch)
treedf5b90befae7b6088e8c3a51a6e88a5321e7c604 /content
parent675a160f4f272e25bcef48f6471a8f1fc71d21b5 (diff)
downloadchromium_src-46d04faeb3289f2362255b942c1c0613025b86b9.zip
chromium_src-46d04faeb3289f2362255b942c1c0613025b86b9.tar.gz
chromium_src-46d04faeb3289f2362255b942c1c0613025b86b9.tar.bz2
Change content shell variable names to be more xplat.
BUG=90445 TEST=none Review URL: http://codereview.chromium.org/8171002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/shell/shell.cc8
-rw-r--r--content/shell/shell.h4
-rw-r--r--content/shell/shell_win.cc53
3 files changed, 32 insertions, 33 deletions
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index e33682e..3e3801b 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -24,8 +24,8 @@ namespace content {
std::vector<Shell*> Shell::windows_;
Shell::Shell()
- : main_window_(NULL),
- edit_window_(NULL)
+ : window_(NULL),
+ url_edit_view_(NULL)
#if defined(OS_WIN)
, default_edit_wnd_proc_(0)
#endif
@@ -62,10 +62,10 @@ Shell* Shell::CreateNewWindow(content::BrowserContext* browser_context,
NULL));
shell->tab_contents_->set_delegate(shell);
-#if defined (OS_WIN)
+#if defined(OS_WIN)
TabContentsViewWin* view =
static_cast<TabContentsViewWin*>(shell->tab_contents_->view());
- view->SetParent(shell->main_window_);
+ view->SetParent(shell->window_);
#endif
shell->PlatformResizeSubViews();
diff --git a/content/shell/shell.h b/content/shell/shell.h
index bea9814..c95c929 100644
--- a/content/shell/shell.h
+++ b/content/shell/shell.h
@@ -95,8 +95,8 @@ class Shell : public TabContentsDelegate {
scoped_ptr<TabContents> tab_contents_;
- gfx::NativeWindow main_window_;
- gfx::NativeEditView edit_window_;
+ gfx::NativeWindow window_;
+ gfx::NativeEditView url_edit_view_;
#if defined(OS_WIN)
WNDPROC default_edit_wnd_proc_;
diff --git a/content/shell/shell_win.cc b/content/shell/shell_win.cc
index 98d08c2..a499189 100644
--- a/content/shell/shell_win.cc
+++ b/content/shell/shell_win.cc
@@ -65,8 +65,8 @@ void Shell::PlatformExit() {
void Shell::PlatformCleanUp() {
// When the window is destroyed, tell the Edit field to forget about us,
// otherwise we will crash.
- ui::SetWindowProc(edit_window_, default_edit_wnd_proc_);
- ui::SetWindowUserData(edit_window_, NULL);
+ ui::SetWindowProc(url_edit_view_, default_edit_wnd_proc_);
+ ui::SetWindowUserData(url_edit_view_, NULL);
}
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
@@ -85,21 +85,21 @@ void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
NOTREACHED() << "Unknown UI control";
return;
}
- EnableWindow(GetDlgItem(main_window_, id), is_enabled);
+ EnableWindow(GetDlgItem(window_, id), is_enabled);
}
void Shell::PlatformSetAddressBarURL(const GURL& url) {
std::wstring url_string = UTF8ToWide(url.spec());
- SendMessage(edit_window_, WM_SETTEXT, 0,
+ SendMessage(url_edit_view_, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(url_string.c_str()));
}
void Shell::PlatformCreateWindow() {
- main_window_ = CreateWindow(kWindowClass, kWindowTitle,
- WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- NULL, NULL, instance_handle_, NULL);
- ui::SetWindowUserData(main_window_, this);
+ window_ = CreateWindow(kWindowClass, kWindowTitle,
+ WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
+ NULL, NULL, instance_handle_, NULL);
+ ui::SetWindowUserData(window_, this);
HWND hwnd;
int x = 0;
@@ -107,45 +107,44 @@ void Shell::PlatformCreateWindow() {
hwnd = CreateWindow(L"BUTTON", L"Back",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON ,
x, 0, kButtonWidth, kURLBarHeight,
- main_window_, (HMENU) IDC_NAV_BACK, instance_handle_, 0);
+ window_, (HMENU) IDC_NAV_BACK, instance_handle_, 0);
x += kButtonWidth;
hwnd = CreateWindow(L"BUTTON", L"Forward",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON ,
x, 0, kButtonWidth, kURLBarHeight,
- main_window_, (HMENU) IDC_NAV_FORWARD, instance_handle_,
- 0);
+ window_, (HMENU) IDC_NAV_FORWARD, instance_handle_, 0);
x += kButtonWidth;
hwnd = CreateWindow(L"BUTTON", L"Reload",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON ,
x, 0, kButtonWidth, kURLBarHeight,
- main_window_, (HMENU) IDC_NAV_RELOAD, instance_handle_,
- 0);
+ window_, (HMENU) IDC_NAV_RELOAD, instance_handle_, 0);
x += kButtonWidth;
hwnd = CreateWindow(L"BUTTON", L"Stop",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON ,
x, 0, kButtonWidth, kURLBarHeight,
- main_window_, (HMENU) IDC_NAV_STOP, instance_handle_, 0);
+ window_, (HMENU) IDC_NAV_STOP, instance_handle_, 0);
x += kButtonWidth;
// This control is positioned by PlatformResizeSubViews.
- edit_window_ = CreateWindow(L"EDIT", 0,
- WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT |
- ES_AUTOVSCROLL | ES_AUTOHSCROLL,
- x, 0, 0, 0, main_window_, 0, instance_handle_, 0);
+ url_edit_view_ = CreateWindow(L"EDIT", 0,
+ WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT |
+ ES_AUTOVSCROLL | ES_AUTOHSCROLL,
+ x, 0, 0, 0, window_, 0, instance_handle_, 0);
- default_edit_wnd_proc_ = ui::SetWindowProc(edit_window_, Shell::EditWndProc);
- ui::SetWindowUserData(edit_window_, this);
+ default_edit_wnd_proc_ = ui::SetWindowProc(url_edit_view_,
+ Shell::EditWndProc);
+ ui::SetWindowUserData(url_edit_view_, this);
- ShowWindow(main_window_, SW_SHOW);
+ ShowWindow(window_, SW_SHOW);
}
void Shell::PlatformSizeTo(int width, int height) {
RECT rc, rw;
- GetClientRect(main_window_, &rc);
- GetWindowRect(main_window_, &rw);
+ GetClientRect(window_, &rc);
+ GetWindowRect(window_, &rw);
int client_width = rc.right - rc.left;
int window_width = rw.right - rw.left;
@@ -158,16 +157,16 @@ void Shell::PlatformSizeTo(int width, int height) {
// Add space for the url bar.
window_height += kURLBarHeight;
- SetWindowPos(main_window_, NULL, 0, 0, window_width, window_height,
+ SetWindowPos(window_, NULL, 0, 0, window_width, window_height,
SWP_NOMOVE | SWP_NOZORDER);
}
void Shell::PlatformResizeSubViews() {
RECT rc;
- GetClientRect(main_window_, &rc);
+ GetClientRect(window_, &rc);
int x = kButtonWidth * 4;
- MoveWindow(edit_window_, x, 0, rc.right - x, kURLBarHeight, TRUE);
+ MoveWindow(url_edit_view_, x, 0, rc.right - x, kURLBarHeight, TRUE);
MoveWindow(GetContentView(), 0, kURLBarHeight, rc.right,
rc.bottom - kURLBarHeight, TRUE);