| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 replacements.SetPathStr(path); | 96 replacements.SetPathStr(path); |
| 97 *url = url->ReplaceComponents(replacements); | 97 *url = url->ReplaceComponents(replacements); |
| 98 | 98 |
| 99 // Having re-written the URL, make the chrome: handler process it. | 99 // Having re-written the URL, make the chrome: handler process it. |
| 100 return false; | 100 return false; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool HandleNonNavigationAboutURL(const GURL& url) { | 103 bool HandleNonNavigationAboutURL(const GURL& url) { |
| 104 const std::string spec(url.spec()); | 104 const std::string spec(url.spec()); |
| 105 | 105 |
| 106 if (LowerCaseEqualsASCII(spec, chrome::kChromeUIRestartURL)) { | 106 if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIRestartURL)) { |
| 107 // Call AttemptRestart after chrome::Navigate() completes to avoid access of | 107 // Call AttemptRestart after chrome::Navigate() completes to avoid access of |
| 108 // gtk objects after they are destroyed by BrowserWindowGtk::Close(). | 108 // gtk objects after they are destroyed by BrowserWindowGtk::Close(). |
| 109 base::MessageLoop::current()->PostTask(FROM_HERE, | 109 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 110 base::Bind(&chrome::AttemptRestart)); | 110 base::Bind(&chrome::AttemptRestart)); |
| 111 return true; | 111 return true; |
| 112 } else if (LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { | 112 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { |
| 113 base::MessageLoop::current()->PostTask(FROM_HERE, | 113 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 114 base::Bind(&chrome::AttemptExit)); | 114 base::Bind(&chrome::AttemptExit)); |
| 115 return true; | 115 return true; |
| 116 } | 116 } |
| 117 | 117 |
| 118 return false; | 118 return false; |
| 119 } | 119 } |
| OLD | NEW |