| 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() const 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual ~FullscreenExitView(); |
| 100 | 100 |
| 101 // views::ButtonListener | 101 // views::ButtonListener |
| 102 virtual void ButtonPressed(views::Button* sender, | 102 virtual void ButtonPressed(views::Button* sender, |
| 103 const ui::Event& event) OVERRIDE; | 103 const ui::Event& event) override; |
| 104 | 104 |
| 105 // views::LinkListener | 105 // views::LinkListener |
| 106 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 106 virtual void LinkClicked(views::Link* source, int event_flags) override; |
| 107 | 107 |
| 108 void UpdateContent(const GURL& url, FullscreenExitBubbleType bubble_type); | 108 void UpdateContent(const GURL& url, FullscreenExitBubbleType bubble_type); |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 FullscreenExitBubbleViews* bubble_; | 111 FullscreenExitBubbleViews* bubble_; |
| 112 | 112 |
| 113 // Clickable hint text for exiting fullscreen mode. | 113 // Clickable hint text for exiting fullscreen mode. |
| 114 views::Link* link_; | 114 views::Link* link_; |
| 115 // Instruction for exiting mouse lock. | 115 // Instruction for exiting mouse lock. |
| 116 views::Label* mouse_lock_exit_instruction_; | 116 views::Label* mouse_lock_exit_instruction_; |
| (...skipping 388 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 |