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

Side by Side Diff: chrome/browser/ui/cocoa/reload_button.h

Issue 6326006: [Mac] Organize some files into chrome/browser/ui/cocoa/toolbar/.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_RELOAD_BUTTON_H_
6 #define CHROME_BROWSER_UI_COCOA_RELOAD_BUTTON_H_
7 #pragma once
8
9 #import <Cocoa/Cocoa.h>
10
11 #import "base/scoped_nsobject.h"
12
13 // NSButton subclass which defers certain state changes when the mouse
14 // is hovering over it.
15
16 @interface ReloadButton : NSButton {
17 @private
18 // Tracks whether the mouse is hovering for purposes of not making
19 // unexpected state changes.
20 BOOL isMouseInside_;
21 scoped_nsobject<NSTrackingArea> trackingArea_;
22
23 // Timer used when setting reload mode while the mouse is hovered.
24 scoped_nsobject<NSTimer> pendingReloadTimer_;
25 }
26
27 // Returns YES if the mouse is currently inside the bounds.
28 - (BOOL)isMouseInside;
29
30 // Update the tag, and the image and tooltip to match. If |anInt|
31 // matches the current tag, no action is taken. |anInt| must be
32 // either |IDC_STOP| or |IDC_RELOAD|.
33 - (void)updateTag:(NSInteger)anInt;
34
35 // Update the button to be a reload button or stop button depending on
36 // |isLoading|. If |force|, always sets the indicated mode. If
37 // |!force|, and the mouse is over the button, defer the transition
38 // from stop button to reload button until the mouse has left the
39 // button, or until |pendingReloadTimer_| fires. This prevents an
40 // inadvertent click _just_ as the state changes.
41 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force;
42
43 @end
44
45 @interface ReloadButton (PrivateTestingMethods)
46 + (void)setPendingReloadTimeout:(NSTimeInterval)seconds;
47 - (NSTrackingArea*)trackingArea;
48 @end
49
50 #endif // CHROME_BROWSER_UI_COCOA_RELOAD_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm ('k') | chrome/browser/ui/cocoa/reload_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698