| 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 "apps/app_shim/extension_app_shim_handler_mac.h" | 5 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 6 | 6 |
| 7 #include "apps/app_shim/app_shim_host_mac.h" | 7 #include "apps/app_shim/app_shim_host_mac.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 app_id_(app_id), | 95 app_id_(app_id), |
| 96 handler_(handler), | 96 handler_(handler), |
| 97 close_count_(0) {} | 97 close_count_(0) {} |
| 98 | 98 |
| 99 MOCK_METHOD1(OnAppLaunchComplete, void(AppShimLaunchResult)); | 99 MOCK_METHOD1(OnAppLaunchComplete, void(AppShimLaunchResult)); |
| 100 | 100 |
| 101 virtual void OnAppClosed() OVERRIDE { | 101 virtual void OnAppClosed() OVERRIDE { |
| 102 handler_->OnShimClose(this); | 102 handler_->OnShimClose(this); |
| 103 ++close_count_; | 103 ++close_count_; |
| 104 } | 104 } |
| 105 virtual void OnAppHide() OVERRIDE {} |
| 105 virtual void OnAppRequestUserAttention() OVERRIDE {} | 106 virtual void OnAppRequestUserAttention() OVERRIDE {} |
| 106 virtual base::FilePath GetProfilePath() const OVERRIDE { | 107 virtual base::FilePath GetProfilePath() const OVERRIDE { |
| 107 return profile_path_; | 108 return profile_path_; |
| 108 } | 109 } |
| 109 virtual std::string GetAppId() const OVERRIDE { return app_id_; } | 110 virtual std::string GetAppId() const OVERRIDE { return app_id_; } |
| 110 | 111 |
| 111 int close_count() { return close_count_; } | 112 int close_count() { return close_count_; } |
| 112 | 113 |
| 113 private: | 114 private: |
| 114 base::FilePath profile_path_; | 115 base::FilePath profile_path_; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 .WillRepeatedly(Return(&profile_a_)); | 349 .WillRepeatedly(Return(&profile_a_)); |
| 349 EXPECT_CALL(*delegate_, LoadProfileAsync(profile_path_a_, _)) | 350 EXPECT_CALL(*delegate_, LoadProfileAsync(profile_path_a_, _)) |
| 350 .WillOnce(Invoke(delegate_, &MockDelegate::CaptureLoadProfileCallback)); | 351 .WillOnce(Invoke(delegate_, &MockDelegate::CaptureLoadProfileCallback)); |
| 351 handler_->OnShimLaunch(&host_aa_, APP_SHIM_LAUNCH_NORMAL); | 352 handler_->OnShimLaunch(&host_aa_, APP_SHIM_LAUNCH_NORMAL); |
| 352 EXPECT_FALSE(handler_->FindHost(&profile_a_, kTestAppIdA)); | 353 EXPECT_FALSE(handler_->FindHost(&profile_a_, kTestAppIdA)); |
| 353 delegate_->RunLoadProfileCallback(profile_path_a_, &profile_a_); | 354 delegate_->RunLoadProfileCallback(profile_path_a_, &profile_a_); |
| 354 EXPECT_TRUE(handler_->FindHost(&profile_a_, kTestAppIdA)); | 355 EXPECT_TRUE(handler_->FindHost(&profile_a_, kTestAppIdA)); |
| 355 } | 356 } |
| 356 | 357 |
| 357 } // namespace apps | 358 } // namespace apps |
| OLD | NEW |