Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: chrome/browser/ui/fullscreen_exit_bubble.cc

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/fullscreen_exit_bubble.h" 5 #include "chrome/browser/ui/fullscreen_exit_bubble.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_commands.h"
11 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
12 #include "grit/ui_strings.h" 13 #include "grit/ui_strings.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
15 16
16 // NOTE(koz): Linux doesn't use the thick shadowed border, so we add padding 17 // NOTE(koz): Linux doesn't use the thick shadowed border, so we add padding
17 // here. 18 // here.
18 #ifdef LINUX 19 #ifdef LINUX
19 const int FullscreenExitBubble::kPaddingPx = 8; 20 const int FullscreenExitBubble::kPaddingPx = 8;
20 #else 21 #else
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 102 }
102 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) || 103 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) ||
103 IsAnimating()) { 104 IsAnimating()) {
104 // The cursor is not idle, and either it's in the slide-in region or it's in 105 // The cursor is not idle, and either it's in the slide-in region or it's in
105 // the neutral region and we're sliding out. 106 // the neutral region and we're sliding out.
106 Show(); 107 Show();
107 } 108 }
108 } 109 }
109 110
110 void FullscreenExitBubble::ToggleFullscreen() { 111 void FullscreenExitBubble::ToggleFullscreen() {
111 browser_->ExecuteCommand(IDC_FULLSCREEN); 112 chrome::ExecuteCommand(browser_, IDC_FULLSCREEN);
112 } 113 }
113 114
114 void FullscreenExitBubble::Accept() { 115 void FullscreenExitBubble::Accept() {
115 browser_->OnAcceptFullscreenPermission(url_, bubble_type_); 116 browser_->OnAcceptFullscreenPermission(url_, bubble_type_);
116 } 117 }
117 118
118 void FullscreenExitBubble::Cancel() { 119 void FullscreenExitBubble::Cancel() {
119 browser_->OnDenyFullscreenPermission(bubble_type_); 120 browser_->OnDenyFullscreenPermission(bubble_type_);
120 } 121 }
121 122
122 string16 FullscreenExitBubble::GetCurrentMessageText() const { 123 string16 FullscreenExitBubble::GetCurrentMessageText() const {
123 return fullscreen_bubble::GetLabelTextForType( 124 return fullscreen_bubble::GetLabelTextForType(
124 bubble_type_, url_, browser_->profile()->GetExtensionService()); 125 bubble_type_, url_, browser_->profile()->GetExtensionService());
125 } 126 }
126 127
127 string16 FullscreenExitBubble::GetCurrentDenyButtonText() const { 128 string16 FullscreenExitBubble::GetCurrentDenyButtonText() const {
128 return fullscreen_bubble::GetDenyButtonTextForType(bubble_type_); 129 return fullscreen_bubble::GetDenyButtonTextForType(bubble_type_);
129 } 130 }
130 131
131 string16 FullscreenExitBubble::GetAllowButtonText() const { 132 string16 FullscreenExitBubble::GetAllowButtonText() const {
132 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW); 133 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW);
133 } 134 }
134 135
135 string16 FullscreenExitBubble::GetInstructionText() const { 136 string16 FullscreenExitBubble::GetInstructionText() const {
136 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, 137 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT,
137 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); 138 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY));
138 } 139 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm ('k') | chrome/browser/ui/gtk/avatar_menu_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698