OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
11 #include "ash/multi_profile_uma.h" | 11 #include "ash/multi_profile_uma.h" |
12 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
14 #include "ash/shelf/shelf_item_delegate_manager.h" | 14 #include "ash/shelf/shelf_item_delegate_manager.h" |
15 #include "ash/shelf/shelf_layout_manager.h" | 15 #include "ash/shelf/shelf_layout_manager.h" |
16 #include "ash/shelf/shelf_model.h" | 16 #include "ash/shelf/shelf_model.h" |
17 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
18 #include "ash/shell.h" | 18 #include "ash/shell.h" |
19 #include "ash/system/tray/system_tray_delegate.h" | 19 #include "ash/system/tray/system_tray_delegate.h" |
20 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
22 #include "base/prefs/scoped_user_pref_update.h" | 22 #include "base/prefs/scoped_user_pref_update.h" |
| 23 #include "base/strings/pattern.h" |
23 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
24 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
25 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
26 #include "base/values.h" | 27 #include "base/values.h" |
27 #include "chrome/browser/app_mode/app_mode_utils.h" | 28 #include "chrome/browser/app_mode/app_mode_utils.h" |
28 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
29 #include "chrome/browser/defaults.h" | 30 #include "chrome/browser/defaults.h" |
30 #include "chrome/browser/extensions/app_icon_loader_impl.h" | 31 #include "chrome/browser/extensions/app_icon_loader_impl.h" |
31 #include "chrome/browser/extensions/extension_util.h" | 32 #include "chrome/browser/extensions/extension_util.h" |
32 #include "chrome/browser/extensions/launch_util.h" | 33 #include "chrome/browser/extensions/launch_util.h" |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 } | 1343 } |
1343 | 1344 |
1344 bool ChromeLauncherController::ContentCanBeHandledByGmailApp( | 1345 bool ChromeLauncherController::ContentCanBeHandledByGmailApp( |
1345 content::WebContents* web_contents) { | 1346 content::WebContents* web_contents) { |
1346 ash::ShelfID id = GetShelfIDForAppID(kGmailAppId); | 1347 ash::ShelfID id = GetShelfIDForAppID(kGmailAppId); |
1347 if (id) { | 1348 if (id) { |
1348 const GURL url = web_contents->GetURL(); | 1349 const GURL url = web_contents->GetURL(); |
1349 // We need to extend the application matching for the gMail app beyond the | 1350 // We need to extend the application matching for the gMail app beyond the |
1350 // manifest file's specification. This is required because of the namespace | 1351 // manifest file's specification. This is required because of the namespace |
1351 // overlap with the offline app ("/mail/mu/"). | 1352 // overlap with the offline app ("/mail/mu/"). |
1352 if (!MatchPattern(url.path(), "/mail/mu/*") && | 1353 if (!base::MatchPattern(url.path(), "/mail/mu/*") && |
1353 MatchPattern(url.path(), "/mail/*") && | 1354 base::MatchPattern(url.path(), "/mail/*") && |
1354 GetExtensionForAppID(kGmailAppId) && | 1355 GetExtensionForAppID(kGmailAppId) && |
1355 GetExtensionForAppID(kGmailAppId)->OverlapsWithOrigin(url)) | 1356 GetExtensionForAppID(kGmailAppId)->OverlapsWithOrigin(url)) |
1356 return true; | 1357 return true; |
1357 } | 1358 } |
1358 return false; | 1359 return false; |
1359 } | 1360 } |
1360 | 1361 |
1361 gfx::Image ChromeLauncherController::GetAppListIcon( | 1362 gfx::Image ChromeLauncherController::GetAppListIcon( |
1362 content::WebContents* web_contents) const { | 1363 content::WebContents* web_contents) const { |
1363 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 1364 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 void ChromeLauncherController::ReleaseProfile() { | 2127 void ChromeLauncherController::ReleaseProfile() { |
2127 if (app_sync_ui_state_) | 2128 if (app_sync_ui_state_) |
2128 app_sync_ui_state_->RemoveObserver(this); | 2129 app_sync_ui_state_->RemoveObserver(this); |
2129 | 2130 |
2130 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); | 2131 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); |
2131 | 2132 |
2132 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 2133 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
2133 | 2134 |
2134 pref_change_registrar_.RemoveAll(); | 2135 pref_change_registrar_.RemoveAll(); |
2135 } | 2136 } |
OLD | NEW |