Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_mac_browsertest.mm

Issue 15269003: Refactor extension handling code from AppShimHost into ExtensionAppShimHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/apps.gypi ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "apps/app_shim/app_shim_handler_mac.h" 5 #include "apps/app_shim/app_shim_handler_mac.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "chrome/browser/ui/app_list/app_list_service.h" 7 #include "chrome/browser/ui/app_list/app_list_service.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/mac/app_mode_common.h" 10 #include "chrome/common/mac/app_mode_common.h"
(...skipping 22 matching lines...) Expand all
33 DCHECK(running_); 33 DCHECK(running_);
34 AppShimHandler::GetForAppMode(app_mode::kAppListModeId)->OnShimFocus(this); 34 AppShimHandler::GetForAppMode(app_mode::kAppListModeId)->OnShimFocus(this);
35 } 35 }
36 36
37 void QuitShim() { 37 void QuitShim() {
38 DCHECK(running_); 38 DCHECK(running_);
39 running_ = false; 39 running_ = false;
40 AppShimHandler::GetForAppMode(app_mode::kAppListModeId)->OnShimClose(this); 40 AppShimHandler::GetForAppMode(app_mode::kAppListModeId)->OnShimClose(this);
41 } 41 }
42 42
43 // AppShimHandler::Host override: 43 // AppShimHandler::Host overrides:
44 virtual void OnAppClosed() OVERRIDE { 44 virtual void OnAppClosed() OVERRIDE {
45 ++close_count_; 45 ++close_count_;
46 QuitShim(); 46 QuitShim();
47 } 47 }
48 virtual Profile* GetProfile() const OVERRIDE {
49 return NULL; // Currently unused in this test.
50 }
51 virtual std::string GetAppId() const OVERRIDE {
52 return app_mode::kAppListModeId;
53 }
48 54
49 int close_count_; 55 int close_count_;
50 bool running_; 56 bool running_;
51 57
52 private: 58 private:
53 DISALLOW_COPY_AND_ASSIGN(AppListServiceMacBrowserTest); 59 DISALLOW_COPY_AND_ASSIGN(AppListServiceMacBrowserTest);
54 }; 60 };
55 61
56 } // namespace 62 } // namespace
57 63
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 EXPECT_EQ(2, close_count_); 105 EXPECT_EQ(2, close_count_);
100 106
101 // Verify that observers are correctly removed by ensuring that |close_count_| 107 // Verify that observers are correctly removed by ensuring that |close_count_|
102 // is unchanged when the app list is dismissed again. 108 // is unchanged when the app list is dismissed again.
103 service->ShowAppList(browser()->profile()); 109 service->ShowAppList(browser()->profile());
104 EXPECT_TRUE(service->IsAppListVisible()); 110 EXPECT_TRUE(service->IsAppListVisible());
105 service->DismissAppList(); 111 service->DismissAppList();
106 EXPECT_FALSE(service->IsAppListVisible()); 112 EXPECT_FALSE(service->IsAppListVisible());
107 EXPECT_EQ(2, close_count_); 113 EXPECT_EQ(2, close_count_);
108 } 114 }
OLDNEW
« no previous file with comments | « apps/apps.gypi ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698