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 #if defined(OS_CHROMEOS) |
| 259 view_ = new FullscreenExitView(this, string16(), url, bubble_type_); |
| 260 #else |
258 ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE); | 261 ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE); |
259 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); | 262 bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); |
260 DCHECK(got_accelerator); | 263 DCHECK(got_accelerator); |
261 view_ = new FullscreenExitView( | 264 view_ = new FullscreenExitView( |
262 this, accelerator.GetShortcutText(), url, bubble_type_); | 265 this, accelerator.GetShortcutText(), url, bubble_type_); |
| 266 #endif |
263 | 267 |
264 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView. | 268 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView. |
265 // Initialize the popup. | 269 // Initialize the popup. |
266 popup_ = new views::Widget; | 270 popup_ = new views::Widget; |
267 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 271 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
268 params.transparent = true; | 272 params.transparent = true; |
269 params.can_activate = false; | 273 params.can_activate = false; |
270 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 274 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
271 params.parent = frame->GetNativeView(); | 275 params.parent = frame->GetNativeView(); |
272 params.bounds = GetPopupRect(false); | 276 params.bounds = GetPopupRect(false); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 385 } |
382 | 386 |
383 bool FullscreenExitBubbleViews::IsAnimating() { | 387 bool FullscreenExitBubbleViews::IsAnimating() { |
384 return size_animation_->GetCurrentValue() != 0; | 388 return size_animation_->GetCurrentValue() != 0; |
385 } | 389 } |
386 | 390 |
387 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { | 391 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { |
388 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) | 392 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) |
389 StartWatchingMouse(); | 393 StartWatchingMouse(); |
390 } | 394 } |
OLD | NEW |