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_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "ash/common/shelf/shelf_application_menu_model.h" | 17 #include "ash/common/shelf/shelf_application_menu_model.h" |
18 #include "ash/common/shelf/shelf_constants.h" | 18 #include "ash/common/shelf/shelf_constants.h" |
19 #include "ash/common/shelf/shelf_controller.h" | 19 #include "ash/common/shelf/shelf_controller.h" |
20 #include "ash/common/shelf/shelf_item_types.h" | |
21 #include "ash/common/shelf/shelf_model.h" | 20 #include "ash/common/shelf/shelf_model.h" |
22 #include "ash/common/shelf/shelf_model_observer.h" | 21 #include "ash/common/shelf/shelf_model_observer.h" |
23 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 22 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
24 #include "ash/common/wm_shell.h" | 23 #include "ash/common/wm_shell.h" |
25 #include "ash/display/screen_orientation_controller_chromeos.h" | 24 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 25 #include "ash/public/cpp/shelf_item.h" |
26 #include "ash/shell.h" | 26 #include "ash/shell.h" |
27 #include "ash/test/ash_test_helper.h" | 27 #include "ash/test/ash_test_helper.h" |
28 #include "ash/test/test_shell_delegate.h" | 28 #include "ash/test/test_shell_delegate.h" |
29 #include "ash/wm/window_util.h" | 29 #include "ash/wm/window_util.h" |
30 #include "base/command_line.h" | 30 #include "base/command_line.h" |
31 #include "base/compiler_specific.h" | 31 #include "base/compiler_specific.h" |
32 #include "base/files/file_path.h" | 32 #include "base/files/file_path.h" |
33 #include "base/json/json_string_value_serializer.h" | 33 #include "base/json/json_string_value_serializer.h" |
34 #include "base/location.h" | 34 #include "base/location.h" |
35 #include "base/macros.h" | 35 #include "base/macros.h" |
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4236 alignment_ = alignment; | 4236 alignment_ = alignment; |
4237 observer_->OnAlignmentChanged(alignment_, display_id); | 4237 observer_->OnAlignmentChanged(alignment_, display_id); |
4238 } | 4238 } |
4239 void SetAutoHideBehavior(ash::ShelfAutoHideBehavior auto_hide, | 4239 void SetAutoHideBehavior(ash::ShelfAutoHideBehavior auto_hide, |
4240 int64_t display_id) override { | 4240 int64_t display_id) override { |
4241 auto_hide_change_count_++; | 4241 auto_hide_change_count_++; |
4242 auto_hide_ = auto_hide; | 4242 auto_hide_ = auto_hide; |
4243 observer_->OnAutoHideBehaviorChanged(auto_hide_, display_id); | 4243 observer_->OnAutoHideBehaviorChanged(auto_hide_, display_id); |
4244 } | 4244 } |
4245 void PinItem( | 4245 void PinItem( |
4246 ash::mojom::ShelfItemPtr item, | 4246 const ash::ShelfItem& item, |
4247 ash::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override {} | 4247 ash::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override {} |
4248 void UnpinItem(const std::string& app_id) override {} | 4248 void UnpinItem(const std::string& app_id) override {} |
4249 void SetItemImage(const std::string& app_id, const SkBitmap& image) override { | 4249 void SetItemImage(const std::string& app_id, const SkBitmap& image) override { |
4250 } | 4250 } |
4251 | 4251 |
4252 private: | 4252 private: |
4253 ash::ShelfAlignment alignment_ = ash::SHELF_ALIGNMENT_BOTTOM_LOCKED; | 4253 ash::ShelfAlignment alignment_ = ash::SHELF_ALIGNMENT_BOTTOM_LOCKED; |
4254 ash::ShelfAutoHideBehavior auto_hide_ = ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN; | 4254 ash::ShelfAutoHideBehavior auto_hide_ = ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN; |
4255 | 4255 |
4256 size_t alignment_change_count_ = 0; | 4256 size_t alignment_change_count_ = 0; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4351 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 4351 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
4352 shelf_controller->auto_hide()); | 4352 shelf_controller->auto_hide()); |
4353 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); | 4353 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); |
4354 | 4354 |
4355 PrefService* prefs = profile()->GetTestingPrefService(); | 4355 PrefService* prefs = profile()->GetTestingPrefService(); |
4356 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); | 4356 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); |
4357 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); | 4357 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); |
4358 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); | 4358 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); |
4359 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); | 4359 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); |
4360 } | 4360 } |
OLD | NEW |