| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/fullscreen_exit_bubble_views.h" | 5 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 Browser* browser, | 248 Browser* browser, |
| 249 const GURL& url, | 249 const GURL& url, |
| 250 FullscreenExitBubbleType bubble_type) | 250 FullscreenExitBubbleType bubble_type) |
| 251 : FullscreenExitBubble(browser, url, bubble_type), | 251 : FullscreenExitBubble(browser, url, bubble_type), |
| 252 root_view_(frame->GetRootView()), | 252 root_view_(frame->GetRootView()), |
| 253 popup_(NULL), | 253 popup_(NULL), |
| 254 size_animation_(new ui::SlideAnimation(this)) { | 254 size_animation_(new ui::SlideAnimation(this)) { |
| 255 size_animation_->Reset(1); | 255 size_animation_->Reset(1); |
| 256 | 256 |
| 257 // Create the contents view. | 257 // Create the contents view. |
| 258 ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE); | 258 ui::Accelerator accelerator(ui::VKEY_UNKNOWN, |
| 259 ui::EF_NONE, |
| 260 ui::ET_KEY_PRESSED); |
| 259 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); | 261 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); |
| 260 DCHECK(got_accelerator); | 262 DCHECK(got_accelerator); |
| 261 view_ = new FullscreenExitView( | 263 view_ = new FullscreenExitView( |
| 262 this, accelerator.GetShortcutText(), url, bubble_type_); | 264 this, accelerator.GetShortcutText(), url, bubble_type_); |
| 263 | 265 |
| 264 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView. | 266 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView. |
| 265 // Initialize the popup. | 267 // Initialize the popup. |
| 266 popup_ = new views::Widget; | 268 popup_ = new views::Widget; |
| 267 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 269 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 268 params.transparent = true; | 270 params.transparent = true; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 383 } |
| 382 | 384 |
| 383 bool FullscreenExitBubbleViews::IsAnimating() { | 385 bool FullscreenExitBubbleViews::IsAnimating() { |
| 384 return size_animation_->GetCurrentValue() != 0; | 386 return size_animation_->GetCurrentValue() != 0; |
| 385 } | 387 } |
| 386 | 388 |
| 387 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { | 389 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { |
| 388 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) | 390 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) |
| 389 StartWatchingMouse(); | 391 StartWatchingMouse(); |
| 390 } | 392 } |
| OLD | NEW |