OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/options/chromeos/about_page_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/about_page_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void UpdateStatusChanged(UpdateLibrary* object) { | 72 virtual void UpdateStatusChanged(UpdateLibrary* object) { |
73 page_handler_->UpdateStatus(object->status()); | 73 page_handler_->UpdateStatus(object->status()); |
74 } | 74 } |
75 | 75 |
76 AboutPageHandler* page_handler_; | 76 AboutPageHandler* page_handler_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(UpdateObserver); | 78 DISALLOW_COPY_AND_ASSIGN(UpdateObserver); |
79 }; | 79 }; |
80 | 80 |
81 AboutPageHandler::AboutPageHandler() | 81 AboutPageHandler::AboutPageHandler() |
82 : CrosOptionsPageUIHandler( | 82 : progress_(-1), |
83 new UserCrosSettingsProvider), | |
84 progress_(-1), | |
85 sticky_(false), | 83 sticky_(false), |
86 started_(false) | 84 started_(false) |
87 {} | 85 {} |
88 | 86 |
89 AboutPageHandler::~AboutPageHandler() { | 87 AboutPageHandler::~AboutPageHandler() { |
90 if (update_observer_.get()) { | 88 if (update_observer_.get()) { |
91 CrosLibrary::Get()->GetUpdateLibrary()-> | 89 CrosLibrary::Get()->GetUpdateLibrary()-> |
92 RemoveObserver(update_observer_.get()); | 90 RemoveObserver(update_observer_.get()); |
93 } | 91 } |
94 } | 92 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 412 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
415 // If UpdateLibrary still has the observer, then the page handler is valid. | 413 // If UpdateLibrary still has the observer, then the page handler is valid. |
416 AboutPageHandler* handler = observer->page_handler(); | 414 AboutPageHandler* handler = observer->page_handler(); |
417 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 415 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
418 handler->web_ui_->CallJavascriptFunction( | 416 handler->web_ui_->CallJavascriptFunction( |
419 "AboutPage.updateSelectedOptionCallback", *channel_string); | 417 "AboutPage.updateSelectedOptionCallback", *channel_string); |
420 } | 418 } |
421 } | 419 } |
422 | 420 |
423 } // namespace chromeos | 421 } // namespace chromeos |
OLD | NEW |