| 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/callback.h" | 10 #include "base/callback.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual void UpdateStatusChanged(UpdateLibrary* object) { | 71 virtual void UpdateStatusChanged(UpdateLibrary* object) { |
| 72 page_handler_->UpdateStatus(object->status()); | 72 page_handler_->UpdateStatus(object->status()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 AboutPageHandler* page_handler_; | 75 AboutPageHandler* page_handler_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(UpdateObserver); | 77 DISALLOW_COPY_AND_ASSIGN(UpdateObserver); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 AboutPageHandler::AboutPageHandler() | 80 AboutPageHandler::AboutPageHandler() |
| 81 : CrosOptionsPageUIHandler( | 81 : progress_(-1), |
| 82 new UserCrosSettingsProvider), | |
| 83 progress_(-1), | |
| 84 sticky_(false), | 82 sticky_(false), |
| 85 started_(false) | 83 started_(false) |
| 86 {} | 84 {} |
| 87 | 85 |
| 88 AboutPageHandler::~AboutPageHandler() { | 86 AboutPageHandler::~AboutPageHandler() { |
| 89 if (update_observer_.get()) { | 87 if (update_observer_.get()) { |
| 90 CrosLibrary::Get()->GetUpdateLibrary()-> | 88 CrosLibrary::Get()->GetUpdateLibrary()-> |
| 91 RemoveObserver(update_observer_.get()); | 89 RemoveObserver(update_observer_.get()); |
| 92 } | 90 } |
| 93 } | 91 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 410 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
| 413 // If UpdateLibrary still has the observer, then the page handler is valid. | 411 // If UpdateLibrary still has the observer, then the page handler is valid. |
| 414 AboutPageHandler* handler = observer->page_handler(); | 412 AboutPageHandler* handler = observer->page_handler(); |
| 415 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 413 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
| 416 handler->web_ui_->CallJavascriptFunction( | 414 handler->web_ui_->CallJavascriptFunction( |
| 417 "AboutPage.updateSelectedOptionCallback", *channel_string); | 415 "AboutPage.updateSelectedOptionCallback", *channel_string); |
| 418 } | 416 } |
| 419 } | 417 } |
| 420 | 418 |
| 421 } // namespace chromeos | 419 } // namespace chromeos |
| OLD | NEW |