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 "ash/multi_profile_uma.h" | 7 #include "ash/multi_profile_uma.h" |
8 #include "ash/public/cpp/shelf_item.h" | 8 #include "ash/public/cpp/shelf_item.h" |
9 #include "ash/public/interfaces/constants.mojom.h" | 9 #include "ash/public/interfaces/constants.mojom.h" |
10 #include "ash/resources/grit/ash_resources.h" | 10 #include "ash/resources/grit/ash_resources.h" |
11 #include "ash/shelf/shelf.h" | 11 #include "ash/shelf/shelf.h" |
12 #include "ash/shelf/shelf_model.h" | 12 #include "ash/shelf/shelf_model.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/shell_port.h" | 14 #include "ash/shell_port.h" |
15 #include "ash/strings/grit/ash_strings.h" | 15 #include "ash/strings/grit/ash_strings.h" |
16 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
17 #include "ash/wm_window.h" | |
18 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
19 #include "base/strings/pattern.h" | 18 #include "base/strings/pattern.h" |
20 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
22 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
23 #include "chrome/browser/chromeos/arc/arc_util.h" | 22 #include "chrome/browser/chromeos/arc/arc_util.h" |
24 #include "chrome/browser/extensions/chrome_app_icon_loader.h" | 23 #include "chrome/browser/extensions/chrome_app_icon_loader.h" |
25 #include "chrome/browser/extensions/extension_util.h" | 24 #include "chrome/browser/extensions/extension_util.h" |
26 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 25 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
27 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "ui/keyboard/keyboard_util.h" | 74 #include "ui/keyboard/keyboard_util.h" |
76 #include "ui/resources/grit/ui_resources.h" | 75 #include "ui/resources/grit/ui_resources.h" |
77 | 76 |
78 using extension_misc::kChromeAppId; | 77 using extension_misc::kChromeAppId; |
79 using extension_misc::kGmailAppId; | 78 using extension_misc::kGmailAppId; |
80 | 79 |
81 namespace { | 80 namespace { |
82 | 81 |
83 int64_t GetDisplayIDForShelf(ash::Shelf* shelf) { | 82 int64_t GetDisplayIDForShelf(ash::Shelf* shelf) { |
84 display::Display display = | 83 display::Display display = |
85 shelf->GetWindow()->GetRootWindow()->GetDisplayNearestWindow(); | 84 display::Screen::GetScreen()->GetDisplayNearestWindow(shelf->GetWindow()); |
86 DCHECK(display.is_valid()); | 85 DCHECK(display.is_valid()); |
87 return display.id(); | 86 return display.id(); |
88 } | 87 } |
89 | 88 |
90 // A callback that does nothing after shelf item selection handling. | 89 // A callback that does nothing after shelf item selection handling. |
91 void NoopCallback(ash::ShelfAction, base::Optional<ash::MenuItemList>) {} | 90 void NoopCallback(ash::ShelfAction, base::Optional<ash::MenuItemList>) {} |
92 | 91 |
93 // Calls ItemSelected with |source|, default arguments, and no callback. | 92 // Calls ItemSelected with |source|, default arguments, and no callback. |
94 void SelectItemWithSource(ash::ShelfItemDelegate* delegate, | 93 void SelectItemWithSource(ash::ShelfItemDelegate* delegate, |
95 ash::ShelfLaunchSource source) { | 94 ash::ShelfLaunchSource source) { |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); | 1373 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); |
1375 | 1374 |
1376 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); | 1375 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); |
1377 DCHECK_GE(app_list_index, 0); | 1376 DCHECK_GE(app_list_index, 0); |
1378 ash::ShelfItem item = model_->items()[app_list_index]; | 1377 ash::ShelfItem item = model_->items()[app_list_index]; |
1379 if (item.title != title) { | 1378 if (item.title != title) { |
1380 item.title = title; | 1379 item.title = title; |
1381 model_->Set(app_list_index, item); | 1380 model_->Set(app_list_index, item); |
1382 } | 1381 } |
1383 } | 1382 } |
OLD | NEW |