| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ime/ime_window.h" | 5 #include "chrome/browser/ui/ime/ime_window.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 window_bounds.set_x(x); | 125 window_bounds.set_x(x); |
| 126 window_bounds.set_y(y); | 126 window_bounds.set_y(y); |
| 127 SetBounds(window_bounds); | 127 SetBounds(window_bounds); |
| 128 } | 128 } |
| 129 | 129 |
| 130 int ImeWindow::GetFrameId() const { | 130 int ImeWindow::GetFrameId() const { |
| 131 return web_contents_->GetMainFrame()->GetRoutingID(); | 131 return web_contents_->GetMainFrame()->GetRoutingID(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void ImeWindow::OnWindowDestroyed() { | 134 void ImeWindow::OnWindowDestroyed() { |
| 135 FOR_EACH_OBSERVER(ImeWindowObserver, observers_, OnWindowDestroyed(this)); | 135 for (ImeWindowObserver& observer : observers_) |
| 136 observer.OnWindowDestroyed(this); |
| 136 native_window_ = nullptr; | 137 native_window_ = nullptr; |
| 137 delete this; | 138 delete this; |
| 138 } | 139 } |
| 139 | 140 |
| 140 void ImeWindow::AddObserver(ImeWindowObserver* observer) { | 141 void ImeWindow::AddObserver(ImeWindowObserver* observer) { |
| 141 observers_.AddObserver(observer); | 142 observers_.AddObserver(observer); |
| 142 } | 143 } |
| 143 | 144 |
| 144 void ImeWindow::RemoveObserver(ImeWindowObserver* observer) { | 145 void ImeWindow::RemoveObserver(ImeWindowObserver* observer) { |
| 145 observers_.RemoveObserver(observer); | 146 observers_.RemoveObserver(observer); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 bounds.set_width(pos.width()); | 195 bounds.set_width(pos.width()); |
| 195 bounds.set_height(pos.height()); | 196 bounds.set_height(pos.height()); |
| 196 native_window_->SetBounds(bounds); | 197 native_window_->SetBounds(bounds); |
| 197 } | 198 } |
| 198 | 199 |
| 199 bool ImeWindow::IsPopupOrPanel(const content::WebContents* source) const { | 200 bool ImeWindow::IsPopupOrPanel(const content::WebContents* source) const { |
| 200 return true; | 201 return true; |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace ui | 204 } // namespace ui |
| OLD | NEW |