| 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/extensions/window_controller.h" | 5 #include "chrome/browser/extensions/window_controller.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 9 #include "chrome/browser/extensions/window_controller_list.h" | 9 #include "chrome/browser/extensions/window_controller_list.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/base_window.h" | 11 #include "chrome/browser/ui/base_window.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
| 17 // WindowController | 17 // WindowController |
| 18 | 18 |
| 19 WindowController::WindowController(BaseWindow* window, Profile* profile) | 19 WindowController::WindowController(BaseWindow* window, Profile* profile) |
| 20 : window_(window), profile_(profile) { | 20 : window_(window), profile_(profile) { |
| 21 WindowControllerList::GetInstance()->AddExtensionWindow(this); | |
| 22 } | 21 } |
| 23 | 22 |
| 24 WindowController::~WindowController() { | 23 WindowController::~WindowController() { |
| 25 WindowControllerList::GetInstance()->RemoveExtensionWindow(this); | |
| 26 } | 24 } |
| 27 | 25 |
| 28 Browser* WindowController::GetBrowser() const { | 26 Browser* WindowController::GetBrowser() const { |
| 29 return NULL; | 27 return NULL; |
| 30 } | 28 } |
| 31 | 29 |
| 32 namespace keys = tabs_constants; | 30 namespace keys = tabs_constants; |
| 33 | 31 |
| 34 base::DictionaryValue* WindowController::CreateWindowValue() const { | 32 base::DictionaryValue* WindowController::CreateWindowValue() const { |
| 35 DictionaryValue* result = new DictionaryValue(); | 33 DictionaryValue* result = new DictionaryValue(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 bounds = window()->GetBounds(); | 57 bounds = window()->GetBounds(); |
| 60 result->SetInteger(keys::kLeftKey, bounds.x()); | 58 result->SetInteger(keys::kLeftKey, bounds.x()); |
| 61 result->SetInteger(keys::kTopKey, bounds.y()); | 59 result->SetInteger(keys::kTopKey, bounds.y()); |
| 62 result->SetInteger(keys::kWidthKey, bounds.width()); | 60 result->SetInteger(keys::kWidthKey, bounds.width()); |
| 63 result->SetInteger(keys::kHeightKey, bounds.height()); | 61 result->SetInteger(keys::kHeightKey, bounds.height()); |
| 64 | 62 |
| 65 return result; | 63 return result; |
| 66 } | 64 } |
| 67 | 65 |
| 68 } // namespace extensions | 66 } // namespace extensions |
| OLD | NEW |