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

Side by Side Diff: ui/aura_shell/launcher/launcher_view.h

Issue 8247012: Positions the launcher in the bottom left corner. Adds ShellDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 2 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 | « ui/aura_shell/launcher/launcher_types.h ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | 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) 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 #ifndef UI_AURA_SHELL_LAUNCHER_VIEW_H_ 5 #ifndef UI_AURA_SHELL_LAUNCHER_VIEW_H_
6 #define UI_AURA_SHELL_LAUNCHER_VIEW_H_ 6 #define UI_AURA_SHELL_LAUNCHER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/aura_shell/launcher/launcher_model_observer.h" 9 #include "ui/aura_shell/launcher/launcher_model_observer.h"
10 #include "views/controls/button/button.h"
10 #include "views/widget/widget_delegate.h" 11 #include "views/widget/widget_delegate.h"
11 12
13 namespace views {
14 class ImageButton;
15 }
16
12 namespace aura_shell { 17 namespace aura_shell {
13 18
19 struct LauncherItem;
14 class LauncherModel; 20 class LauncherModel;
15 21
16 namespace internal { 22 namespace internal {
17 23
18 class LauncherButton;
19
20 class LauncherView : public views::WidgetDelegateView, 24 class LauncherView : public views::WidgetDelegateView,
21 public LauncherModelObserver { 25 public LauncherModelObserver,
26 public views::ButtonListener {
22 public: 27 public:
23 LauncherView(); 28 explicit LauncherView(LauncherModel* model);
24 virtual ~LauncherView(); 29 virtual ~LauncherView();
25 30
26 // Populates this LauncherView from the contents of |model|. 31 void Init();
27 void Init(LauncherModel* model);
28 32
29 private: 33 private:
34 // Creates the view used to represent |item|.
35 views::View* CreateViewForItem(const LauncherItem& item);
36
37 // Resizes the widget to fit the view.
38 void Resize();
39
30 // Overridden from views::View: 40 // Overridden from views::View:
31 virtual void Layout() OVERRIDE; 41 virtual void Layout() OVERRIDE;
32 virtual gfx::Size GetPreferredSize() OVERRIDE; 42 virtual gfx::Size GetPreferredSize() OVERRIDE;
33 43
34 // Overridden from LauncherModelObserver: 44 // Overridden from LauncherModelObserver:
35 virtual void LauncherItemAdded(int index) OVERRIDE; 45 virtual void LauncherItemAdded(int index) OVERRIDE;
36 virtual void LauncherItemRemoved(int index) OVERRIDE; 46 virtual void LauncherItemRemoved(int index) OVERRIDE;
37 virtual void LauncherSelectionChanged() OVERRIDE; 47 virtual void LauncherItemImagesChanged(int index) OVERRIDE;
38 48
39 // The model, we don't own it. 49 // Overriden from views::ButtonListener:
50 virtual void ButtonPressed(views::Button* sender,
51 const views::Event& event) OVERRIDE;
52
53 // The model; owned by Launcher.
40 LauncherModel* model_; 54 LauncherModel* model_;
41 55
56 views::ImageButton* new_browser_button_;
57
58 views::ImageButton* show_apps_button_;
59
42 DISALLOW_COPY_AND_ASSIGN(LauncherView); 60 DISALLOW_COPY_AND_ASSIGN(LauncherView);
43 }; 61 };
44 62
45 } // namespace internal 63 } // namespace internal
46 } // namespace aura_shell 64 } // namespace aura_shell
47 65
48 #endif // UI_AURA_SHELL_LAUNCHER_VIEW_H_ 66 #endif // UI_AURA_SHELL_LAUNCHER_VIEW_H_
OLDNEW
« no previous file with comments | « ui/aura_shell/launcher/launcher_types.h ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698