| OLD | NEW |
| 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_EXTENSIONS_SHELL_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 10 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 10 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // If true, don't show the window after creation. | 77 // If true, don't show the window after creation. |
| 78 bool hidden; | 78 bool hidden; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 static ShellWindow* Create(Profile* profile, | 81 static ShellWindow* Create(Profile* profile, |
| 82 const extensions::Extension* extension, | 82 const extensions::Extension* extension, |
| 83 const GURL& url, | 83 const GURL& url, |
| 84 const CreateParams& params); | 84 const CreateParams& params); |
| 85 | 85 |
| 86 // Specifies a url for the launcher icon. |
| 87 void SetAppIconUrl(const GURL& icon_url); |
| 88 |
| 86 // Convert draggable regions in raw format to SkRegion format. Caller is | 89 // Convert draggable regions in raw format to SkRegion format. Caller is |
| 87 // responsible for deleting the returned SkRegion instance. | 90 // responsible for deleting the returned SkRegion instance. |
| 88 static SkRegion* RawDraggableRegionsToSkRegion( | 91 static SkRegion* RawDraggableRegionsToSkRegion( |
| 89 const std::vector<extensions::DraggableRegion>& regions); | 92 const std::vector<extensions::DraggableRegion>& regions); |
| 90 | 93 |
| 91 const std::string& window_key() const { return window_key_; } | 94 const std::string& window_key() const { return window_key_; } |
| 92 const SessionID& session_id() const { return session_id_; } | 95 const SessionID& session_id() const { return session_id_; } |
| 93 const extensions::Extension* extension() const { return extension_; } | 96 const extensions::Extension* extension() const { return extension_; } |
| 94 content::WebContents* web_contents() const { return web_contents_.get(); } | 97 content::WebContents* web_contents() const { return web_contents_.get(); } |
| 95 WindowType window_type() const { return window_type_; } | 98 WindowType window_type() const { return window_type_; } |
| 96 Profile* profile() const { return profile_; } | 99 Profile* profile() const { return profile_; } |
| 97 const gfx::Image& app_icon() const { return app_icon_; } | 100 const gfx::Image& app_icon() const { return app_icon_; } |
| 101 const GURL& app_icon_url() { return app_icon_url_; } |
| 98 | 102 |
| 99 NativeAppWindow* GetBaseWindow(); | 103 NativeAppWindow* GetBaseWindow(); |
| 100 gfx::NativeWindow GetNativeWindow(); | 104 gfx::NativeWindow GetNativeWindow(); |
| 101 | 105 |
| 102 // NativeAppWindows should call this to determine what the window's title | 106 // NativeAppWindows should call this to determine what the window's title |
| 103 // is on startup and from within UpdateWindowTitle(). | 107 // is on startup and from within UpdateWindowTitle(). |
| 104 virtual string16 GetTitle() const; | 108 virtual string16 GetTitle() const; |
| 105 | 109 |
| 106 // Call to notify ShellRegistry and delete the window. Subclasses should | 110 // Call to notify ShellRegistry and delete the window. Subclasses should |
| 107 // invoke this method instead of using "delete this". | 111 // invoke this method instead of using "delete this". |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 WindowType window_type_; | 218 WindowType window_type_; |
| 215 content::NotificationRegistrar registrar_; | 219 content::NotificationRegistrar registrar_; |
| 216 ExtensionFunctionDispatcher extension_function_dispatcher_; | 220 ExtensionFunctionDispatcher extension_function_dispatcher_; |
| 217 | 221 |
| 218 // Icon showed in the task bar. | 222 // Icon showed in the task bar. |
| 219 gfx::Image app_icon_; | 223 gfx::Image app_icon_; |
| 220 | 224 |
| 221 // Used for loading app_icon_. | 225 // Used for loading app_icon_. |
| 222 scoped_ptr<ImageLoadingTracker> app_icon_loader_; | 226 scoped_ptr<ImageLoadingTracker> app_icon_loader_; |
| 223 | 227 |
| 228 // Icon URL to be used for setting the app icon. If not empty, app_icon_ will |
| 229 // be fetched and set using this URL. |
| 230 GURL app_icon_url_; |
| 231 |
| 224 scoped_ptr<NativeAppWindow> native_app_window_; | 232 scoped_ptr<NativeAppWindow> native_app_window_; |
| 225 | 233 |
| 226 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 234 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
| 227 }; | 235 }; |
| 228 | 236 |
| 229 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 237 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| OLD | NEW |