| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/fullscreen_exit_bubble.h" | 5 #include "chrome/browser/views/fullscreen_exit_bubble.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/l10n_util_win.h" | 9 #include "app/l10n_util_win.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); | 137 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); |
| 138 DCHECK(got_accelerator); | 138 DCHECK(got_accelerator); |
| 139 view_ = new FullscreenExitView(this, popup_, accelerator.GetShortcutText()); | 139 view_ = new FullscreenExitView(this, popup_, accelerator.GetShortcutText()); |
| 140 | 140 |
| 141 // Initialize the popup. | 141 // Initialize the popup. |
| 142 popup_->set_delete_on_destroy(false); | 142 popup_->set_delete_on_destroy(false); |
| 143 popup_->set_window_style(WS_POPUP); | 143 popup_->set_window_style(WS_POPUP); |
| 144 popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | | 144 popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | |
| 145 l10n_util::GetExtendedTooltipStyles()); | 145 l10n_util::GetExtendedTooltipStyles()); |
| 146 popup_->SetOpacity(static_cast<unsigned char>(0xff * kOpacity)); | 146 popup_->SetOpacity(static_cast<unsigned char>(0xff * kOpacity)); |
| 147 popup_->Init(frame->GetNativeView(), GetPopupRect(false)); | 147 popup_->Init(frame->GetNativeView(), GetPopupRect(false), false); |
| 148 popup_->SetContentsView(view_); | 148 popup_->SetContentsView(view_); |
| 149 popup_->Show(); // This does not activate the popup. | 149 popup_->Show(); // This does not activate the popup. |
| 150 | 150 |
| 151 // Start the initial delay timer and begin watching the mouse. | 151 // Start the initial delay timer and begin watching the mouse. |
| 152 initial_delay_.Start(base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 152 initial_delay_.Start(base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
| 153 &FullscreenExitBubble::CheckMousePosition); | 153 &FullscreenExitBubble::CheckMousePosition); |
| 154 POINT cursor_pos; | 154 POINT cursor_pos; |
| 155 GetCursorPos(&cursor_pos); | 155 GetCursorPos(&cursor_pos); |
| 156 last_mouse_pos_ = cursor_pos; | 156 last_mouse_pos_ = cursor_pos; |
| 157 views::View::ConvertPointToView(NULL, root_view_, &last_mouse_pos_); | 157 views::View::ConvertPointToView(NULL, root_view_, &last_mouse_pos_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 bool ignore_animation_state) const { | 258 bool ignore_animation_state) const { |
| 259 gfx::Size size(view_->GetPreferredSize()); | 259 gfx::Size size(view_->GetPreferredSize()); |
| 260 if (!ignore_animation_state) { | 260 if (!ignore_animation_state) { |
| 261 size.set_height(static_cast<int>(static_cast<double>(size.height()) * | 261 size.set_height(static_cast<int>(static_cast<double>(size.height()) * |
| 262 size_animation_->GetCurrentValue())); | 262 size_animation_->GetCurrentValue())); |
| 263 } | 263 } |
| 264 gfx::Point origin((root_view_->width() - size.width()) / 2, 0); | 264 gfx::Point origin((root_view_->width() - size.width()) / 2, 0); |
| 265 views::View::ConvertPointToScreen(root_view_, &origin); | 265 views::View::ConvertPointToScreen(root_view_, &origin); |
| 266 return gfx::Rect(origin, size); | 266 return gfx::Rect(origin, size); |
| 267 } | 267 } |
| OLD | NEW |