| 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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Space between the site info label and the buttons / link. | 42 // Space between the site info label and the buttons / link. |
| 43 const int kMiddlePaddingPx = 30; | 43 const int kMiddlePaddingPx = 30; |
| 44 | 44 |
| 45 class ButtonView : public views::View { | 45 class ButtonView : public views::View { |
| 46 public: | 46 public: |
| 47 ButtonView(views::ButtonListener* listener, int between_button_spacing); | 47 ButtonView(views::ButtonListener* listener, int between_button_spacing); |
| 48 virtual ~ButtonView(); | 48 virtual ~ButtonView(); |
| 49 | 49 |
| 50 // Returns an empty size when the view is not visible. | 50 // Returns an empty size when the view is not visible. |
| 51 virtual gfx::Size GetPreferredSize() OVERRIDE; | 51 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 52 | 52 |
| 53 views::LabelButton* accept_button() const { return accept_button_; } | 53 views::LabelButton* accept_button() const { return accept_button_; } |
| 54 views::LabelButton* deny_button() const { return deny_button_; } | 54 views::LabelButton* deny_button() const { return deny_button_; } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 views::LabelButton* accept_button_; | 57 views::LabelButton* accept_button_; |
| 58 views::LabelButton* deny_button_; | 58 views::LabelButton* deny_button_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(ButtonView); | 60 DISALLOW_COPY_AND_ASSIGN(ButtonView); |
| 61 }; | 61 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 74 deny_button_->SetFocusable(false); | 74 deny_button_->SetFocusable(false); |
| 75 AddChildView(deny_button_); | 75 AddChildView(deny_button_); |
| 76 | 76 |
| 77 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, | 77 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, |
| 78 between_button_spacing)); | 78 between_button_spacing)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 ButtonView::~ButtonView() { | 81 ButtonView::~ButtonView() { |
| 82 } | 82 } |
| 83 | 83 |
| 84 gfx::Size ButtonView::GetPreferredSize() { | 84 gfx::Size ButtonView::GetPreferredSize() const { |
| 85 return visible() ? views::View::GetPreferredSize() : gfx::Size(); | 85 return visible() ? views::View::GetPreferredSize() : gfx::Size(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 | 89 |
| 90 class FullscreenExitBubbleViews::FullscreenExitView | 90 class FullscreenExitBubbleViews::FullscreenExitView |
| 91 : public views::View, | 91 : public views::View, |
| 92 public views::ButtonListener, | 92 public views::ButtonListener, |
| 93 public views::LinkListener { | 93 public views::LinkListener { |
| 94 public: | 94 public: |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 const content::NotificationDetails& details) { | 505 const content::NotificationDetails& details) { |
| 506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
| 507 UpdateForImmersiveState(); | 507 UpdateForImmersiveState(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( | 510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( |
| 511 views::Widget* widget, | 511 views::Widget* widget, |
| 512 bool visible) { | 512 bool visible) { |
| 513 UpdateMouseWatcher(); | 513 UpdateMouseWatcher(); |
| 514 } | 514 } |
| OLD | NEW |