| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #if !defined(OS_CHROMEOS) | 48 #if !defined(OS_CHROMEOS) |
| 49 link_.SetText( | 49 link_.SetText( |
| 50 l10n_util::GetStringFUTF16(IDS_EXIT_FULLSCREEN_MODE, | 50 l10n_util::GetStringFUTF16(IDS_EXIT_FULLSCREEN_MODE, |
| 51 WideToUTF16(accelerator))); | 51 WideToUTF16(accelerator))); |
| 52 #else | 52 #else |
| 53 link_.SetText(l10n_util::GetStringUTF16(IDS_EXIT_FULLSCREEN_MODE)); | 53 link_.SetText(l10n_util::GetStringUTF16(IDS_EXIT_FULLSCREEN_MODE)); |
| 54 #endif | 54 #endif |
| 55 link_.set_listener(bubble); | 55 link_.set_listener(bubble); |
| 56 link_.SetFont(ResourceBundle::GetSharedInstance().GetFont( | 56 link_.SetFont(ResourceBundle::GetSharedInstance().GetFont( |
| 57 ResourceBundle::LargeFont)); | 57 ResourceBundle::LargeFont)); |
| 58 link_.SetNormalColor(SK_ColorWHITE); | 58 link_.SetBackgroundColor(SK_ColorBLACK); |
| 59 link_.SetHighlightedColor(SK_ColorWHITE); | 59 link_.SetEnabledColor(SK_ColorWHITE); |
| 60 link_.SetPressedColor(SK_ColorWHITE); |
| 60 AddChildView(&link_); | 61 AddChildView(&link_); |
| 61 } | 62 } |
| 62 | 63 |
| 63 FullscreenExitBubbleViews::FullscreenExitView::~FullscreenExitView() { | 64 FullscreenExitBubbleViews::FullscreenExitView::~FullscreenExitView() { |
| 64 } | 65 } |
| 65 | 66 |
| 66 gfx::Size FullscreenExitBubbleViews::FullscreenExitView::GetPreferredSize() { | 67 gfx::Size FullscreenExitBubbleViews::FullscreenExitView::GetPreferredSize() { |
| 67 gfx::Size preferred_size(link_.GetPreferredSize()); | 68 gfx::Size preferred_size(link_.GetPreferredSize()); |
| 68 preferred_size.Enlarge(kPaddingPx * 2, kPaddingPx * 2); | 69 preferred_size.Enlarge(kPaddingPx * 2, kPaddingPx * 2); |
| 69 return preferred_size; | 70 return preferred_size; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 205 } |
| 205 // NOTE: don't use the bounds of the root_view_. On linux changing window | 206 // NOTE: don't use the bounds of the root_view_. On linux changing window |
| 206 // size is async. Instead we use the size of the screen. | 207 // size is async. Instead we use the size of the screen. |
| 207 gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow( | 208 gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow( |
| 208 root_view_->GetWidget()->GetNativeView()); | 209 root_view_->GetWidget()->GetNativeView()); |
| 209 gfx::Point origin(screen_bounds.x() + | 210 gfx::Point origin(screen_bounds.x() + |
| 210 (screen_bounds.width() - size.width()) / 2, | 211 (screen_bounds.width() - size.width()) / 2, |
| 211 screen_bounds.y()); | 212 screen_bounds.y()); |
| 212 return gfx::Rect(origin, size); | 213 return gfx::Rect(origin, size); |
| 213 } | 214 } |
| OLD | NEW |