diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 17:53:30 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 17:53:30 +0000 |
commit | 1a6bb1a9d6805997a53130b55d651012034007df (patch) | |
tree | ac59987c6d1918cca59a867e92f05d634c31bf87 /chrome/browser/browser.cc | |
parent | 0d395bdee7ebb251bcabe06f4eb81a0b6570392e (diff) | |
download | chromium_src-1a6bb1a9d6805997a53130b55d651012034007df.zip chromium_src-1a6bb1a9d6805997a53130b55d651012034007df.tar.gz chromium_src-1a6bb1a9d6805997a53130b55d651012034007df.tar.bz2 |
These files were missed from my last cleanup CL.
Fix bustage.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 61 |
1 files changed, 4 insertions, 57 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 26e676a..5323e10 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -697,7 +697,7 @@ void Browser::ActivateContents(TabContents* contents) { } HWND Browser::GetTopLevelHWND() const { - return window_ ? reinterpret_cast<HWND>(window_->GetPlatformID()) : NULL; + return window_ ? reinterpret_cast<HWND>(window_->GetNativeHandle()) : NULL; } void Browser::LoadingStateChanged(TabContents* source) { @@ -890,53 +890,6 @@ bool Browser::ShouldDisplayURLField() { return !IsApplication(); } -void Browser::SaveWindowPlacementToDatabase() { - // We don't want to be the ones who cause lazy initialization of the session - // service. This function gets called during initial window showing, and we - // don't want to bring in the session service this early. - if (!profile()->HasSessionService()) - return; - SessionService* session_service = profile()->GetSessionService(); - if (!session_service) - return; - - WINDOWPLACEMENT wp; - wp.length = sizeof(wp); - - HWND hwnd = reinterpret_cast<HWND>(window_->GetPlatformID()); - if (!::GetWindowPlacement(hwnd, &wp)) - return; - - session_service->SetWindowBounds(session_id_, - gfx::Rect(wp.rcNormalPosition), - (wp.showCmd & SW_MAXIMIZE) == SW_MAXIMIZE); -} - -void Browser::SaveWindowPlacement() { - WINDOWPLACEMENT wp; - wp.length = sizeof(wp); - - HWND hwnd = reinterpret_cast<HWND>(window_->GetPlatformID()); - if (!::GetWindowPlacement(hwnd, &wp)) - return; - - PrefService* prefs = g_browser_process->local_state(); - DCHECK(prefs); - std::wstring name(prefs::kBrowserWindowPlacement); - if (!app_name_.empty()) { - name.append(L"_"); - name.append(app_name_); - } - - DictionaryValue* win_pref = prefs->GetMutableDictionary(name.c_str()); - DCHECK(win_pref); - win_pref->SetInteger(L"top", wp.rcNormalPosition.top); - win_pref->SetInteger(L"left", wp.rcNormalPosition.left); - win_pref->SetInteger(L"bottom", wp.rcNormalPosition.bottom); - win_pref->SetInteger(L"right", wp.rcNormalPosition.right); - win_pref->SetBoolean(L"maximized", wp.showCmd == SW_SHOWMAXIMIZED); -} - void Browser::FocusLocationBar() { LocationBarView* location_bar = GetLocationBarView(); if (location_bar) @@ -1194,8 +1147,10 @@ void Browser::CreateNewStripWithContents(TabContents* detached_contents, DCHECK(type_ == BrowserType::TABBED_BROWSER); // Create an empty new browser window the same size as the old one. + // TODO(beng): move elsewhere CRect browser_rect; - GetWindowRect(reinterpret_cast<HWND>(window_->GetPlatformID()), &browser_rect); + GetWindowRect(reinterpret_cast<HWND>(window_->GetNativeHandle()), + &browser_rect); gfx::Rect rect(0, 0); if (drop_point.x() != 0 || drop_point.y() != 0) { rect.SetRect(drop_point.x(), drop_point.y(), browser_rect.Width(), @@ -1251,14 +1206,6 @@ TabContents* Browser::CreateTabContentsForURL( return contents; } -void Browser::ShowApplicationMenu(const gfx::Point& p) { - if (!window_) - return; - - HWND hwnd = reinterpret_cast<HWND>(window_->GetPlatformID()); - RunSimpleFrameMenu(p, hwnd); -} - void Browser::ValidateLoadingAnimations() { if (window_) window_->ValidateThrobber(); |