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

Side by Side Diff: ash/wm/workspace/frame_maximize_button.cc

Issue 9834015: Adds a tooltip to the frame maximize button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Scott can't spel Created 8 years, 9 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
« no previous file with comments | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/wm/workspace/frame_maximize_button.h" 5 #include "ash/wm/workspace/frame_maximize_button.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/property_util.h" 9 #include "ash/wm/property_util.h"
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
11 #include "ash/wm/workspace/phantom_window_controller.h" 11 #include "ash/wm/workspace/phantom_window_controller.h"
12 #include "ash/wm/workspace/snap_sizer.h" 12 #include "ash/wm/workspace/snap_sizer.h"
13 #include "grit/ash_strings.h"
13 #include "grit/ui_resources.h" 14 #include "grit/ui_resources.h"
14 #include "ui/aura/event.h" 15 #include "ui/aura/event.h"
15 #include "ui/aura/event_filter.h" 16 #include "ui/aura/event_filter.h"
17 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/gfx/image/image.h" 19 #include "ui/gfx/image/image.h"
18 #include "ui/gfx/screen.h" 20 #include "ui/gfx/screen.h"
19 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
20 #include "ui/views/window/non_client_view.h" 22 #include "ui/views/window/non_client_view.h"
21 23
22 using ash::internal::SnapSizer; 24 using ash::internal::SnapSizer;
23 25
24 namespace ash { 26 namespace ash {
25 27
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 93
92 FrameMaximizeButton::FrameMaximizeButton(views::ButtonListener* listener, 94 FrameMaximizeButton::FrameMaximizeButton(views::ButtonListener* listener,
93 views::NonClientFrameView* frame) 95 views::NonClientFrameView* frame)
94 : ImageButton(listener), 96 : ImageButton(listener),
95 frame_(frame), 97 frame_(frame),
96 is_snap_enabled_(false), 98 is_snap_enabled_(false),
97 exceeded_drag_threshold_(false), 99 exceeded_drag_threshold_(false),
98 snap_type_(SNAP_NONE) { 100 snap_type_(SNAP_NONE) {
99 // TODO(sky): nuke this. It's temporary while we don't have good images. 101 // TODO(sky): nuke this. It's temporary while we don't have good images.
100 SetImageAlignment(ALIGN_LEFT, ALIGN_BOTTOM); 102 SetImageAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
103 SetTooltipText(l10n_util::GetStringUTF16(IDS_FRAME_MAXIMIZE_BUTTON_TOOLTIP));
101 } 104 }
102 105
103 FrameMaximizeButton::~FrameMaximizeButton() { 106 FrameMaximizeButton::~FrameMaximizeButton() {
104 } 107 }
105 108
106 bool FrameMaximizeButton::OnMousePressed(const views::MouseEvent& event) { 109 bool FrameMaximizeButton::OnMousePressed(const views::MouseEvent& event) {
107 is_snap_enabled_ = event.IsLeftMouseButton(); 110 is_snap_enabled_ = event.IsLeftMouseButton();
108 if (is_snap_enabled_) { 111 if (is_snap_enabled_) {
109 snap_sizer_.reset(NULL); 112 snap_sizer_.reset(NULL);
110 InstallEventFilter(); 113 InstallEventFilter();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 break; 325 break;
323 case SNAP_MINIMIZE: 326 case SNAP_MINIMIZE:
324 frame_->GetWidget()->Minimize(); 327 frame_->GetWidget()->Minimize();
325 break; 328 break;
326 default: 329 default:
327 NOTREACHED(); 330 NOTREACHED();
328 } 331 }
329 } 332 }
330 333
331 } // namespace ash 334 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698