OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_VIEWS_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_APP_LAUNCHER_H_ |
6 #define CHROME_BROWSER_VIEWS_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_VIEWS_APP_LAUNCHER_H_ |
7 | 7 |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 9 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
10 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 10 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
(...skipping 37 matching lines...) Loading... |
48 // TabContents is added to the Browser. | 48 // TabContents is added to the Browser. |
49 // . If the page requests a URL to be open (OpenURLFromTab), OpenURL is | 49 // . If the page requests a URL to be open (OpenURLFromTab), OpenURL is |
50 // invoked on the browser. | 50 // invoked on the browser. |
51 // | 51 // |
52 // When a new url is opened, or the user clicks outsides the bounds of the | 52 // When a new url is opened, or the user clicks outsides the bounds of the |
53 // widget the app launcher is closed. | 53 // widget the app launcher is closed. |
54 class AppLauncher : public InfoBubbleDelegate, | 54 class AppLauncher : public InfoBubbleDelegate, |
55 public RenderViewHostDelegate, | 55 public RenderViewHostDelegate, |
56 public RenderViewHostDelegate::View { | 56 public RenderViewHostDelegate::View { |
57 public: | 57 public: |
| 58 // Shows an application launcher bubble pointing to the |bounds| (which should |
| 59 // be in screen coordinates). |
| 60 // The caller DOES NOT OWN the AppLauncher returned. It is deleted |
| 61 // automatically when the AppLauncher is closed. |
| 62 static AppLauncher* Show(Browser* browser, const gfx::Rect& bounds); |
| 63 |
58 // Shows an application launcher bubble pointing to the new tab button. | 64 // Shows an application launcher bubble pointing to the new tab button. |
59 // The caller DOES NOT OWN the AppLauncher returned. It is deleted | 65 // The caller DOES NOT OWN the AppLauncher returned. It is deleted |
60 // automatically when the AppLauncher is closed. | 66 // automatically when the AppLauncher is closed. |
61 static AppLauncher* Show(Browser* browser); | 67 static AppLauncher* ShowForNewTab(Browser* browser); |
62 | 68 |
63 // Returns the browser this AppLauncher is associated with. | 69 // Returns the browser this AppLauncher is associated with. |
64 Browser* browser() const { return browser_; } | 70 Browser* browser() const { return browser_; } |
65 | 71 |
66 // Hides the app launcher. | 72 // Hides the app launcher. |
67 void Hide(); | 73 void Hide(); |
68 | 74 |
69 // InfoBubbleDelegate overrides. | 75 // InfoBubbleDelegate overrides. |
70 virtual void InfoBubbleClosing(InfoBubble* info_bubble, | 76 virtual void InfoBubbleClosing(InfoBubble* info_bubble, |
71 bool closed_by_escape); | 77 bool closed_by_escape); |
(...skipping 72 matching lines...) Loading... |
144 // TabContents created when the user clicks a link. | 150 // TabContents created when the user clicks a link. |
145 scoped_ptr<TabContents> pending_contents_; | 151 scoped_ptr<TabContents> pending_contents_; |
146 | 152 |
147 // The view with the navigation bar and render view, shown in the info-bubble. | 153 // The view with the navigation bar and render view, shown in the info-bubble. |
148 InfoBubbleContentsView* info_bubble_content_; | 154 InfoBubbleContentsView* info_bubble_content_; |
149 | 155 |
150 DISALLOW_COPY_AND_ASSIGN(AppLauncher); | 156 DISALLOW_COPY_AND_ASSIGN(AppLauncher); |
151 }; | 157 }; |
152 | 158 |
153 #endif // CHROME_BROWSER_VIEWS_APP_LAUNCHER_H_ | 159 #endif // CHROME_BROWSER_VIEWS_APP_LAUNCHER_H_ |
OLD | NEW |