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 "ash/common/devtools/ash_devtools_css_agent.h" | 5 #include "ash/common/devtools/ash_devtools_css_agent.h" |
6 | 6 |
7 #include "ash/common/wm_lookup.h" | 7 #include "ash/common/wm_lookup.h" |
8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 std::unique_ptr<ui::devtools::protocol::Array< | 122 std::unique_ptr<ui::devtools::protocol::Array< |
123 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits, | 123 ui::devtools::protocol::CSS::StyleDeclarationEdit>> edits, |
124 std::unique_ptr< | 124 std::unique_ptr< |
125 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>* | 125 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>>* |
126 result) { | 126 result) { |
127 std::unique_ptr< | 127 std::unique_ptr< |
128 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>> | 128 ui::devtools::protocol::Array<ui::devtools::protocol::CSS::CSSStyle>> |
129 updated_styles = ui::devtools::protocol::Array< | 129 updated_styles = ui::devtools::protocol::Array< |
130 ui::devtools::protocol::CSS::CSSStyle>::create(); | 130 ui::devtools::protocol::CSS::CSSStyle>::create(); |
131 for (size_t i = 0; i < edits->length(); i++) { | 131 for (size_t i = 0; i < edits->length(); i++) { |
132 const auto& edit = edits->get(i); | 132 auto* edit = edits->get(i); |
133 int node_id; | 133 int node_id; |
134 if (!base::StringToInt(edit->getStyleSheetId(), &node_id)) | 134 if (!base::StringToInt(edit->getStyleSheetId(), &node_id)) |
135 return ui::devtools::protocol::Response::Error("Invalid node id"); | 135 return ui::devtools::protocol::Response::Error("Invalid node id"); |
136 | 136 |
137 gfx::Rect updated_bounds; | 137 gfx::Rect updated_bounds; |
138 if (!GetBoundsForNodeId(node_id, &updated_bounds)) { | 138 if (!GetBoundsForNodeId(node_id, &updated_bounds)) { |
139 return ui::devtools::protocol::Response::Error( | 139 return ui::devtools::protocol::Response::Error( |
140 "No node found with that id"); | 140 "No node found with that id"); |
141 } | 141 } |
142 | 142 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (view) { | 219 if (view) { |
220 view->SetBoundsRect(bounds); | 220 view->SetBoundsRect(bounds); |
221 return true; | 221 return true; |
222 } | 222 } |
223 | 223 |
224 return false; | 224 return false; |
225 } | 225 } |
226 | 226 |
227 } // namespace devtools | 227 } // namespace devtools |
228 } // namespace ash | 228 } // namespace ash |
OLD | NEW |