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

Side by Side Diff: chrome/browser/ui/panels/panel.h

Issue 11308259: chrome: Extract CommandUpdaterDelegate into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FakeCommandObserver Created 8 years 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) 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 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_ 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "chrome/browser/command_updater.h" 13 #include "chrome/browser/command_updater.h"
14 #include "chrome/browser/command_updater_delegate.h"
14 #include "chrome/browser/extensions/image_loading_tracker.h" 15 #include "chrome/browser/extensions/image_loading_tracker.h"
15 #include "chrome/browser/sessions/session_id.h" 16 #include "chrome/browser/sessions/session_id.h"
16 #include "chrome/browser/ui/base_window.h" 17 #include "chrome/browser/ui/base_window.h"
17 #include "chrome/browser/ui/panels/panel_constants.h" 18 #include "chrome/browser/ui/panels/panel_constants.h"
18 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 20 #include "content/public/browser/notification_registrar.h"
20 #include "ui/gfx/image/image.h" 21 #include "ui/gfx/image/image.h"
21 #include "ui/gfx/rect.h" 22 #include "ui/gfx/rect.h"
22 23
23 class GURL; 24 class GURL;
(...skipping 16 matching lines...) Expand all
40 // A platform independent implementation of BaseWindow for Panels. 41 // A platform independent implementation of BaseWindow for Panels.
41 // This class gets the first crack at all the BaseWindow calls for Panels and 42 // This class gets the first crack at all the BaseWindow calls for Panels and
42 // does one or more of the following: 43 // does one or more of the following:
43 // - Do nothing. The function is not relevant to Panels. 44 // - Do nothing. The function is not relevant to Panels.
44 // - Do Panel specific platform independent processing and then invoke the 45 // - Do Panel specific platform independent processing and then invoke the
45 // function on the platform specific member. For example, restrict panel 46 // function on the platform specific member. For example, restrict panel
46 // size to certain limits. 47 // size to certain limits.
47 // - Invoke an appropriate PanelManager function to do stuff that might affect 48 // - Invoke an appropriate PanelManager function to do stuff that might affect
48 // other Panels. For example deleting a panel would rearrange other panels. 49 // other Panels. For example deleting a panel would rearrange other panels.
49 class Panel : public BaseWindow, 50 class Panel : public BaseWindow,
50 public CommandUpdater::CommandUpdaterDelegate, 51 public CommandUpdaterDelegate,
51 public content::NotificationObserver, 52 public content::NotificationObserver,
52 public ImageLoadingTracker::Observer { 53 public ImageLoadingTracker::Observer {
53 public: 54 public:
54 enum ExpansionState { 55 enum ExpansionState {
55 // The panel is fully expanded with both title-bar and the client-area. 56 // The panel is fully expanded with both title-bar and the client-area.
56 EXPANDED, 57 EXPANDED,
57 // The panel is shown with the title-bar only. 58 // The panel is shown with the title-bar only.
58 TITLE_ONLY, 59 TITLE_ONLY,
59 // The panel is shown with 3-pixel line. 60 // The panel is shown with 3-pixel line.
60 MINIMIZED 61 MINIMIZED
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 virtual void Close() OVERRIDE; 128 virtual void Close() OVERRIDE;
128 virtual void Activate() OVERRIDE; 129 virtual void Activate() OVERRIDE;
129 virtual void Deactivate() OVERRIDE; 130 virtual void Deactivate() OVERRIDE;
130 virtual void Maximize() OVERRIDE; 131 virtual void Maximize() OVERRIDE;
131 virtual void Minimize() OVERRIDE; 132 virtual void Minimize() OVERRIDE;
132 virtual void Restore() OVERRIDE; 133 virtual void Restore() OVERRIDE;
133 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 134 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
134 virtual void FlashFrame(bool flash) OVERRIDE; 135 virtual void FlashFrame(bool flash) OVERRIDE;
135 virtual bool IsAlwaysOnTop() const OVERRIDE; 136 virtual bool IsAlwaysOnTop() const OVERRIDE;
136 137
137 // Overridden from CommandUpdater::CommandUpdaterDelegate: 138 // Overridden from CommandUpdaterDelegate:
138 virtual void ExecuteCommandWithDisposition( 139 virtual void ExecuteCommandWithDisposition(
139 int id, 140 int id,
140 WindowOpenDisposition disposition) OVERRIDE; 141 WindowOpenDisposition disposition) OVERRIDE;
141 142
142 // content::NotificationObserver overrides. 143 // content::NotificationObserver overrides.
143 virtual void Observe(int type, 144 virtual void Observe(int type,
144 const content::NotificationSource& source, 145 const content::NotificationSource& source,
145 const content::NotificationDetails& details) OVERRIDE; 146 const content::NotificationDetails& details) OVERRIDE;
146 147
147 // Construct a native panel implementation. 148 // Construct a native panel implementation.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 // Used for loading app_icon_. 385 // Used for loading app_icon_.
385 scoped_ptr<ImageLoadingTracker> app_icon_loader_; 386 scoped_ptr<ImageLoadingTracker> app_icon_loader_;
386 387
387 // Icon showed in the task bar. 388 // Icon showed in the task bar.
388 gfx::Image app_icon_; 389 gfx::Image app_icon_;
389 390
390 DISALLOW_COPY_AND_ASSIGN(Panel); 391 DISALLOW_COPY_AND_ASSIGN(Panel);
391 }; 392 };
392 393
393 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ 394 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698