| 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 27 matching lines...) Expand all Loading... |
| 38 // FullscreenExitView ---------------------------------------------------------- | 38 // FullscreenExitView ---------------------------------------------------------- |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 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 ~ButtonView() override; |
| 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() const override; | 51 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 27 matching lines...) Expand all Loading... |
| 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: |
| 95 FullscreenExitView(FullscreenExitBubbleViews* bubble, | 95 FullscreenExitView(FullscreenExitBubbleViews* bubble, |
| 96 const base::string16& accelerator, | 96 const base::string16& accelerator, |
| 97 const GURL& url, | 97 const GURL& url, |
| 98 FullscreenExitBubbleType bubble_type); | 98 FullscreenExitBubbleType bubble_type); |
| 99 virtual ~FullscreenExitView(); | 99 ~FullscreenExitView() override; |
| 100 | 100 |
| 101 // views::ButtonListener | 101 // views::ButtonListener |
| 102 virtual void ButtonPressed(views::Button* sender, | 102 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 103 const ui::Event& event) override; | |
| 104 | 103 |
| 105 // views::LinkListener | 104 // views::LinkListener |
| 106 virtual void LinkClicked(views::Link* source, int event_flags) override; | 105 void LinkClicked(views::Link* source, int event_flags) override; |
| 107 | 106 |
| 108 void UpdateContent(const GURL& url, FullscreenExitBubbleType bubble_type); | 107 void UpdateContent(const GURL& url, FullscreenExitBubbleType bubble_type); |
| 109 | 108 |
| 110 private: | 109 private: |
| 111 FullscreenExitBubbleViews* bubble_; | 110 FullscreenExitBubbleViews* bubble_; |
| 112 | 111 |
| 113 // Clickable hint text for exiting fullscreen mode. | 112 // Clickable hint text for exiting fullscreen mode. |
| 114 views::Link* link_; | 113 views::Link* link_; |
| 115 // Instruction for exiting mouse lock. | 114 // Instruction for exiting mouse lock. |
| 116 views::Label* mouse_lock_exit_instruction_; | 115 views::Label* mouse_lock_exit_instruction_; |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 const content::NotificationDetails& details) { | 504 const content::NotificationDetails& details) { |
| 506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 505 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
| 507 UpdateForImmersiveState(); | 506 UpdateForImmersiveState(); |
| 508 } | 507 } |
| 509 | 508 |
| 510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( | 509 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( |
| 511 views::Widget* widget, | 510 views::Widget* widget, |
| 512 bool visible) { | 511 bool visible) { |
| 513 UpdateMouseWatcher(); | 512 UpdateMouseWatcher(); |
| 514 } | 513 } |
| OLD | NEW |