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

Side by Side Diff: chrome/browser/chromeos/login/app_launch_controller.cc

Issue 166573005: Rename apps::ShellWindow to apps::AppWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, nits (rename) Created 6 years, 10 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 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/chromeos/login/app_launch_controller.h" 5 #include "chrome/browser/chromeos/login/app_launch_controller.h"
6 6
7 #include "apps/shell_window.h" 7 #include "apps/app_window.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/json/json_file_value_serializer.h" 12 #include "base/json/json_file_value_serializer.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
(...skipping 29 matching lines...) Expand all
48 base::Closure* AppLaunchController::network_timeout_callback_ = NULL; 48 base::Closure* AppLaunchController::network_timeout_callback_ = NULL;
49 AppLaunchController::ReturnBoolCallback* 49 AppLaunchController::ReturnBoolCallback*
50 AppLaunchController::can_configure_network_callback_ = NULL; 50 AppLaunchController::can_configure_network_callback_ = NULL;
51 AppLaunchController::ReturnBoolCallback* 51 AppLaunchController::ReturnBoolCallback*
52 AppLaunchController::need_owner_auth_to_configure_network_callback_ = NULL; 52 AppLaunchController::need_owner_auth_to_configure_network_callback_ = NULL;
53 53
54 //////////////////////////////////////////////////////////////////////////////// 54 ////////////////////////////////////////////////////////////////////////////////
55 // AppLaunchController::AppWindowWatcher 55 // AppLaunchController::AppWindowWatcher
56 56
57 class AppLaunchController::AppWindowWatcher 57 class AppLaunchController::AppWindowWatcher
58 : public apps::ShellWindowRegistry::Observer { 58 : public apps::AppWindowRegistry::Observer {
59 public: 59 public:
60 explicit AppWindowWatcher(AppLaunchController* controller, 60 explicit AppWindowWatcher(AppLaunchController* controller,
61 const std::string& app_id) 61 const std::string& app_id)
62 : controller_(controller), 62 : controller_(controller),
63 app_id_(app_id), 63 app_id_(app_id),
64 window_registry_(apps::ShellWindowRegistry::Get(controller->profile_)), 64 window_registry_(apps::AppWindowRegistry::Get(controller->profile_)),
65 weak_factory_(this) { 65 weak_factory_(this) {
66 if (!window_registry_->GetShellWindowsForApp(app_id).empty()) { 66 if (!window_registry_->GetAppWindowsForApp(app_id).empty()) {
67 base::MessageLoop::current()->PostTask( 67 base::MessageLoop::current()->PostTask(
68 FROM_HERE, 68 FROM_HERE,
69 base::Bind(&AppWindowWatcher::NotifyAppWindowCreated, 69 base::Bind(&AppWindowWatcher::NotifyAppWindowCreated,
70 weak_factory_.GetWeakPtr())); 70 weak_factory_.GetWeakPtr()));
71 return; 71 return;
72 } else { 72 } else {
73 window_registry_->AddObserver(this); 73 window_registry_->AddObserver(this);
74 } 74 }
75 } 75 }
76 virtual ~AppWindowWatcher() { 76 virtual ~AppWindowWatcher() {
77 window_registry_->RemoveObserver(this); 77 window_registry_->RemoveObserver(this);
78 } 78 }
79 79
80 private: 80 private:
81 // apps::ShellWindowRegistry::Observer overrides: 81 // apps::AppWindowRegistry::Observer overrides:
82 virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE { 82 virtual void OnAppWindowAdded(apps::AppWindow* app_window) OVERRIDE {
83 if (shell_window->extension_id() == app_id_) { 83 if (app_window->extension_id() == app_id_) {
84 window_registry_->RemoveObserver(this); 84 window_registry_->RemoveObserver(this);
85 NotifyAppWindowCreated(); 85 NotifyAppWindowCreated();
86 } 86 }
87 } 87 }
88 virtual void OnShellWindowIconChanged( 88 virtual void OnAppWindowIconChanged(apps::AppWindow* app_window) OVERRIDE {}
89 apps::ShellWindow* shell_window) OVERRIDE {} 89 virtual void OnAppWindowRemoved(apps::AppWindow* app_window) OVERRIDE {}
90 virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE {}
91 90
92 void NotifyAppWindowCreated() { 91 void NotifyAppWindowCreated() {
93 controller_->OnAppWindowCreated(); 92 controller_->OnAppWindowCreated();
94 } 93 }
95 94
96 AppLaunchController* controller_; 95 AppLaunchController* controller_;
97 std::string app_id_; 96 std::string app_id_;
98 apps::ShellWindowRegistry* window_registry_; 97 apps::AppWindowRegistry* window_registry_;
99 base::WeakPtrFactory<AppWindowWatcher> weak_factory_; 98 base::WeakPtrFactory<AppWindowWatcher> weak_factory_;
100 99
101 DISALLOW_COPY_AND_ASSIGN(AppWindowWatcher); 100 DISALLOW_COPY_AND_ASSIGN(AppWindowWatcher);
102 }; 101 };
103 102
104 //////////////////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////////
105 // AppLaunchController 104 // AppLaunchController
106 105
107 AppLaunchController::AppLaunchController(const std::string& app_id, 106 AppLaunchController::AppLaunchController(const std::string& app_id,
108 bool diagnostic_mode, 107 bool diagnostic_mode,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 << ", error=" << error; 396 << ", error=" << error;
398 DCHECK_NE(KioskAppLaunchError::NONE, error); 397 DCHECK_NE(KioskAppLaunchError::NONE, error);
399 398
400 // Saves the error and ends the session to go back to login screen. 399 // Saves the error and ends the session to go back to login screen.
401 KioskAppLaunchError::Save(error); 400 KioskAppLaunchError::Save(error);
402 chrome::AttemptUserExit(); 401 chrome::AttemptUserExit();
403 CleanUp(); 402 CleanUp();
404 } 403 }
405 404
406 } // namespace chromeos 405 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_manager_browsertest.cc ('k') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698