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_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 11 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
| 14 class Browser; |
14 class URLPattern; | 15 class URLPattern; |
15 | 16 |
16 namespace aura { | 17 namespace aura { |
17 class Window; | 18 class Window; |
18 } | 19 } |
19 | 20 |
20 namespace extensions { | 21 namespace extensions { |
21 class Extension; | 22 class Extension; |
22 } | 23 } |
23 | 24 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 content::WebContents* GetLRUApplication(); | 63 content::WebContents* GetLRUApplication(); |
63 | 64 |
64 // Returns true if this app matches the given |web_contents|. To accelerate | 65 // Returns true if this app matches the given |web_contents|. To accelerate |
65 // the matching, the app managing |extension| as well as the parsed | 66 // the matching, the app managing |extension| as well as the parsed |
66 // |refocus_pattern| get passed. If |is_app| is true, the application gets | 67 // |refocus_pattern| get passed. If |is_app| is true, the application gets |
67 // first checked against its original URL since a windowed app might have | 68 // first checked against its original URL since a windowed app might have |
68 // navigated away from its app domain. | 69 // navigated away from its app domain. |
69 bool WebContentMatchesApp(const extensions::Extension* extension, | 70 bool WebContentMatchesApp(const extensions::Extension* extension, |
70 const URLPattern& refocus_pattern, | 71 const URLPattern& refocus_pattern, |
71 content::WebContents* web_contents, | 72 content::WebContents* web_contents, |
72 bool is_app); | 73 Browser* browser); |
73 | 74 |
74 // Activate the browser with the given |content| and show the associated tab. | 75 // Activate the browser with the given |content| and show the associated tab. |
75 void ActivateContent(content::WebContents* content); | 76 void ActivateContent(content::WebContents* content); |
76 | 77 |
77 // Advance to the next item if an owned item is already active. The function | 78 // Advance to the next item if an owned item is already active. The function |
78 // will return true if it has sucessfully advanced. | 79 // will return true if it has sucessfully advanced. |
79 bool AdvanceToNextApp(); | 80 bool AdvanceToNextApp(); |
80 | 81 |
81 // Returns true if the application is a V2 app. | 82 // Returns true if the application is a V2 app. |
82 bool IsV2App(); | 83 bool IsV2App(); |
83 | 84 |
84 // Returns true if it is allowed to try starting a V2 app again. | 85 // Returns true if it is allowed to try starting a V2 app again. |
85 bool AllowNextLaunchAttempt(); | 86 bool AllowNextLaunchAttempt(); |
86 | 87 |
87 GURL refocus_url_; | 88 GURL refocus_url_; |
88 | 89 |
89 // Since V2 applications can be undetectable after launching, this timer is | 90 // Since V2 applications can be undetectable after launching, this timer is |
90 // keeping track of the last launch attempt. | 91 // keeping track of the last launch attempt. |
91 base::Time last_launch_attempt_; | 92 base::Time last_launch_attempt_; |
92 | 93 |
93 ChromeLauncherController* chrome_launcher_controller_; | 94 ChromeLauncherController* chrome_launcher_controller_; |
94 | 95 |
95 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); | 96 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); |
96 }; | 97 }; |
97 | 98 |
98 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ | 99 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ |
OLD | NEW |