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

Side by Side Diff: chrome/browser/chromeos/login/test/app_window_waiter.cc

Issue 494033002: Move AppWindow to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded include in chrome_shell_delegate.cc Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/test/app_window_waiter.h" 5 #include "chrome/browser/chromeos/login/test/app_window_waiter.h"
6 6
7 #include "apps/app_window.h" 7 #include "extensions/browser/app_window/app_window.h"
8 8
9 namespace chromeos { 9 namespace chromeos {
10 10
11 AppWindowWaiter::AppWindowWaiter(apps::AppWindowRegistry* registry, 11 AppWindowWaiter::AppWindowWaiter(extensions::AppWindowRegistry* registry,
12 const std::string& app_id) 12 const std::string& app_id)
13 : registry_(registry), app_id_(app_id), window_(NULL) { 13 : registry_(registry), app_id_(app_id), window_(NULL) {
14 registry_->AddObserver(this); 14 registry_->AddObserver(this);
15 } 15 }
16 16
17 AppWindowWaiter::~AppWindowWaiter() { 17 AppWindowWaiter::~AppWindowWaiter() {
18 registry_->RemoveObserver(this); 18 registry_->RemoveObserver(this);
19 } 19 }
20 20
21 apps::AppWindow* AppWindowWaiter::Wait() { 21 extensions::AppWindow* AppWindowWaiter::Wait() {
22 window_ = registry_->GetCurrentAppWindowForApp(app_id_); 22 window_ = registry_->GetCurrentAppWindowForApp(app_id_);
23 if (window_) 23 if (window_)
24 return window_; 24 return window_;
25 25
26 run_loop_.Run(); 26 run_loop_.Run();
27 27
28 return window_; 28 return window_;
29 } 29 }
30 30
31 void AppWindowWaiter::OnAppWindowAdded(apps::AppWindow* app_window) { 31 void AppWindowWaiter::OnAppWindowAdded(extensions::AppWindow* app_window) {
32 if (!run_loop_.running()) 32 if (!run_loop_.running())
33 return; 33 return;
34 34
35 if (app_window->extension_id() == app_id_) { 35 if (app_window->extension_id() == app_id_) {
36 window_ = app_window; 36 window_ = app_window;
37 run_loop_.Quit(); 37 run_loop_.Quit();
38 } 38 }
39 } 39 }
40 40
41 } // namespace chromeos 41 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698