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 #import "ui/app_list/cocoa/app_list_view_controller.h" | 5 #import "ui/app_list/cocoa/app_list_view_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 namespace app_list { | 82 namespace app_list { |
83 | 83 |
84 class AppListModelObserverBridge : public AppListModelObserver { | 84 class AppListModelObserverBridge : public AppListModelObserver { |
85 public: | 85 public: |
86 AppListModelObserverBridge(AppListViewController* parent); | 86 AppListModelObserverBridge(AppListViewController* parent); |
87 virtual ~AppListModelObserverBridge(); | 87 virtual ~AppListModelObserverBridge(); |
88 | 88 |
89 private: | 89 private: |
90 // Overridden from app_list::AppListModelObserver: | 90 // Overridden from app_list::AppListModelObserver: |
91 virtual void OnAppListModelUsersChanged() OVERRIDE; | |
92 virtual void OnAppListModelSigninStatusChanged() OVERRIDE; | 91 virtual void OnAppListModelSigninStatusChanged() OVERRIDE; |
93 | 92 |
94 AppListViewController* parent_; // Weak. Owns us. | 93 AppListViewController* parent_; // Weak. Owns us. |
95 | 94 |
96 DISALLOW_COPY_AND_ASSIGN(AppListModelObserverBridge); | 95 DISALLOW_COPY_AND_ASSIGN(AppListModelObserverBridge); |
97 }; | 96 }; |
98 | 97 |
99 AppListModelObserverBridge::AppListModelObserverBridge( | 98 AppListModelObserverBridge::AppListModelObserverBridge( |
100 AppListViewController* parent) | 99 AppListViewController* parent) |
101 : parent_(parent) { | 100 : parent_(parent) { |
102 [[parent_ appsGridController] model]->AddObserver(this); | 101 [[parent_ appsGridController] model]->AddObserver(this); |
103 } | 102 } |
104 | 103 |
105 AppListModelObserverBridge::~AppListModelObserverBridge() { | 104 AppListModelObserverBridge::~AppListModelObserverBridge() { |
106 [[parent_ appsGridController] model]->RemoveObserver(this); | 105 [[parent_ appsGridController] model]->RemoveObserver(this); |
107 } | 106 } |
108 | 107 |
109 void AppListModelObserverBridge::OnAppListModelUsersChanged() { | |
110 [parent_ onSigninStatusChanged]; | |
111 } | |
112 | |
113 void AppListModelObserverBridge::OnAppListModelSigninStatusChanged() { | 108 void AppListModelObserverBridge::OnAppListModelSigninStatusChanged() { |
114 [parent_ onSigninStatusChanged]; | 109 [parent_ onSigninStatusChanged]; |
115 } | 110 } |
116 | 111 |
117 } // namespace app_list | 112 } // namespace app_list |
118 | 113 |
119 @implementation AppListViewController | 114 @implementation AppListViewController |
120 | 115 |
121 - (id)init { | 116 - (id)init { |
122 if ((self = [super init])) { | 117 if ((self = [super init])) { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 345 |
351 [backgroundView_ setHidden:YES]; | 346 [backgroundView_ setHidden:YES]; |
352 signinViewController_.reset( | 347 signinViewController_.reset( |
353 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | 348 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] |
354 cornerRadius:kBubbleCornerRadius | 349 cornerRadius:kBubbleCornerRadius |
355 delegate:signinDelegate]); | 350 delegate:signinDelegate]); |
356 [[self view] addSubview:[signinViewController_ view]]; | 351 [[self view] addSubview:[signinViewController_ view]]; |
357 } | 352 } |
358 | 353 |
359 @end | 354 @end |
OLD | NEW |