summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/browser_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 02:00:53 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 02:00:53 +0000
commit7a16aeeb28850afdf5d512cc2e4bb2e58f4b1c10 (patch)
tree1070bdfc922ca45660dc6bf56b26fc19dfeba7d6 /chrome/browser/views/frame/browser_view.cc
parentf47c61458a0c89c9ec57b3bb3a51d4ef46528ca6 (diff)
downloadchromium_src-7a16aeeb28850afdf5d512cc2e4bb2e58f4b1c10.zip
chromium_src-7a16aeeb28850afdf5d512cc2e4bb2e58f4b1c10.tar.gz
chromium_src-7a16aeeb28850afdf5d512cc2e4bb2e58f4b1c10.tar.bz2
Last couple of bits of new-frame related cleanup:
- Remove frame_util.cc, moving functions to BrowserList (endsession) and BrowserView (GetBrowserWindowForHWND) - Tidy up interface for TabIconView model. The model now sources only the information it needs (loading state and favicon). - Replace BrowserType class with an enum on Browser. http://crbug.com/2320 http://crbug.com/3363 Review URL: http://codereview.chromium.org/10786 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/browser_view.cc')
-rw-r--r--chrome/browser/views/frame/browser_view.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 01ff721..35fb7b8 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -138,6 +138,16 @@ BrowserView::~BrowserView() {
ticker_.UnregisterTickHandler(&hung_window_detector_);
}
+// static
+BrowserWindow* BrowserView::GetBrowserWindowForHWND(HWND window) {
+ if (IsWindow(window)) {
+ HANDLE data = GetProp(window, kBrowserWindowKey);
+ if (data)
+ return reinterpret_cast<BrowserWindow*>(data);
+ }
+ return NULL;
+}
+
int BrowserView::GetShowState() const {
STARTUPINFO si = {0};
si.cb = sizeof(si);
@@ -187,7 +197,7 @@ bool BrowserView::IsOffTheRecord() const {
}
bool BrowserView::ShouldShowOffTheRecordAvatar() const {
- return IsOffTheRecord() && browser_->type() == BrowserType::TABBED_BROWSER;
+ return IsOffTheRecord() && browser_->type() == Browser::TYPE_NORMAL;
}
bool BrowserView::AcceleratorPressed(const views::Accelerator& accelerator) {
@@ -281,13 +291,13 @@ bool BrowserView::SupportsWindowFeature(WindowFeature feature) const {
}
// static
-unsigned int BrowserView::FeaturesForBrowserType(BrowserType::Type type) {
+unsigned int BrowserView::FeaturesForBrowserType(Browser::Type type) {
unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF;
- if (type == BrowserType::TABBED_BROWSER)
+ if (type == Browser::TYPE_NORMAL)
features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR | FEATURE_BOOKMARKBAR;
- if (type != BrowserType::APPLICATION)
+ if (type != Browser::TYPE_APP)
features |= FEATURE_LOCATIONBAR;
- if (type != BrowserType::TABBED_BROWSER)
+ if (type != Browser::TYPE_NORMAL)
features |= FEATURE_TITLEBAR;
return features;
}
@@ -686,7 +696,7 @@ bool BrowserView::ShouldShowWindowTitle() const {
}
SkBitmap BrowserView::GetWindowIcon() {
- if (browser_->type() == BrowserType::APPLICATION)
+ if (browser_->type() == Browser::TYPE_APP)
return browser_->GetCurrentPageIcon();
return SkBitmap();
}
@@ -725,7 +735,7 @@ void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds,
bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const {
*bounds = browser_->GetSavedWindowBounds();
- if (browser_->type() == BrowserType::BROWSER) {
+ if (browser_->type() == Browser::TYPE_POPUP) {
// We are a popup window. The value passed in |bounds| represents two
// pieces of information:
// - the position of the window, in screen coordinates (outer position).
@@ -966,7 +976,7 @@ void BrowserView::InitSystemMenu() {
int insertion_index = std::max(0, system_menu_->ItemCount() - 1);
// We add the menu items in reverse order so that insertion_index never needs
// to change.
- if (browser_->type() == BrowserType::TABBED_BROWSER) {
+ if (browser_->type() == Browser::TYPE_NORMAL) {
system_menu_->AddSeparator(insertion_index);
system_menu_->AddMenuItemWithLabel(insertion_index, IDC_TASKMANAGER,
l10n_util::GetString(IDS_TASKMANAGER));