~abreu-alexandre/oxide/add-quota-permission-context-support

« back to all changes in this revision

Viewing changes to shared/browser/oxide_browser_main_parts.cc

  • Committer: Chris Coulson
  • Date: 2016-02-07 00:18:39 UTC
  • mfrom: (1323.1.13 drag-and-drop)
  • Revision ID: chris.coulson@canonical.com-20160207001839-csmhxgr0xc852qg6
Add support for drag and drop

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
#include "oxide_message_pump.h"
59
59
#include "oxide_power_save_blocker.h"
60
60
#include "oxide_render_process_initializer.h"
 
61
#include "oxide_screen_client.h"
61
62
#include "oxide_web_contents_view.h"
62
63
 
63
64
namespace oxide {
64
65
 
65
66
namespace {
66
67
 
67
 
blink::WebScreenInfo DefaultScreenInfoGetter() {
68
 
  return BrowserPlatformIntegration::GetInstance()->GetDefaultScreenInfo();
69
 
}
70
 
 
71
68
scoped_ptr<media::VideoCaptureDeviceFactory> CreateVideoCaptureDeviceFactory(
72
69
    scoped_ptr<media::VideoCaptureDeviceFactory> delegate) {
73
70
  return make_scoped_ptr(
143
140
  Screen() {}
144
141
 
145
142
  gfx::Point GetCursorScreenPoint() final {
146
 
    NOTIMPLEMENTED();
 
143
    NOTREACHED();
147
144
    return gfx::Point();
148
145
  }
149
146
 
150
147
  gfx::NativeWindow GetWindowUnderCursor() final {
151
 
    NOTIMPLEMENTED();
 
148
    NOTREACHED();
152
149
    return nullptr;
153
150
  }
154
151
 
155
152
  gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) final {
156
 
    NOTIMPLEMENTED();
 
153
    NOTREACHED();
157
154
    return nullptr;
158
155
  }
159
156
 
160
157
  int GetNumDisplays() const final {
161
 
    NOTIMPLEMENTED();
 
158
    NOTREACHED();
162
159
    return 1;
163
160
  }
164
161
 
165
162
  std::vector<gfx::Display> GetAllDisplays() const final {
166
 
    NOTIMPLEMENTED();
 
163
    NOTREACHED();
167
164
    return std::vector<gfx::Display>();
168
165
  }
169
166
 
172
169
    //  is the NativeView for the corresponding RenderWidgetHostView. It would
173
170
    //  be nice to find a way to cleverly map this to the associated RWHV and
174
171
    //  get the correct display
175
 
    return GetPrimaryDisplay();
 
172
    return gfx::Display();
176
173
  }
177
174
 
178
175
  gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const final {
179
 
    NOTIMPLEMENTED();
 
176
    NOTREACHED();
180
177
    return gfx::Display();
181
178
  }
182
179
 
183
180
  gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const final {
184
 
    NOTIMPLEMENTED();
 
181
    NOTREACHED();
185
182
    return gfx::Display();
186
183
  }
187
184
 
188
185
  gfx::Display GetPrimaryDisplay() const final {
189
 
    blink::WebScreenInfo info(
190
 
        BrowserPlatformIntegration::GetInstance()->GetDefaultScreenInfo());
191
 
 
192
 
    gfx::Display display;
193
 
    display.set_bounds(info.rect);
194
 
    display.set_work_area(info.availableRect);
195
 
    display.set_device_scale_factor(info.deviceScaleFactor);
196
 
 
197
 
    return display;
 
186
    return BrowserPlatformIntegration::GetInstance()
 
187
        ->GetScreenClient()
 
188
        ->GetPrimaryDisplay();
198
189
  }
199
190
 
200
191
  void AddObserver(gfx::DisplayObserver* observer) final {
201
 
    NOTIMPLEMENTED();
 
192
    NOTREACHED();
202
193
  }
203
194
  void RemoveObserver(gfx::DisplayObserver* observer) final {
204
 
    NOTIMPLEMENTED();
 
195
    NOTREACHED();
205
196
  }
206
197
};
207
198
 
208
199
} // namespace
209
200
 
210
201
void BrowserMainParts::PreEarlyInitialization() {
211
 
  content::SetDefaultScreenInfoGetterOxide(DefaultScreenInfoGetter);
212
202
  content::SetWebContentsViewOxideFactory(WebContentsView::Create);
213
203
  content::SetPowerSaveBlockerOxideDelegateFactory(CreatePowerSaveBlocker);
214
204
  media::SetVideoCaptureDeviceFactoryOverrideFactory(